From 5df73f7be789ee169c3fb1faa9f2c7bf28e57c7e Mon Sep 17 00:00:00 2001 From: Jeroen Simonetti Date: Wed, 9 Oct 2019 17:41:08 +0200 Subject: [PATCH] Use netlink attribute en-/decoder infrastructure (#61) Use netlink attribute en-/decoder infrastructure This should pave the way for endian aware code. Ref #56 Signed-off-by: Jeroen Simonetti --- address.go | 122 +++---- endian.go | 13 + go.mod | 9 +- go.sum | 31 +- link.go | 313 ++++++++---------- link_test.go | 4 +- neigh.go | 95 +++--- route.go | 123 +++---- ...062276f7138164404d06d2174670196ad862d75-25 | Bin 0 -> 116 bytes ...1d3ec3c421bf5b9b724960e251c41500ad13acb-41 | Bin 0 -> 132 bytes ...2f189d9277857267e86c16aa6efecf73a828246-41 | Bin 0 -> 124 bytes ...51d210d4813c4559f3ba2a14d7f3c92382aeb19-32 | Bin 0 -> 142 bytes ...5dfdc3a5f0c02497c82df67ab5201f90deb53e0-30 | Bin 0 -> 86 bytes ...6e0230b9a33c22d5ac2528f70f272fb4f562b35-25 | Bin 0 -> 38 bytes ...74da7dda3821705debb429b28b0b62cc1eaaace-28 | Bin 0 -> 94 bytes ...7d9be705d50f0432fcb33b20ebcbcfa30e4f2a9-26 | Bin 0 -> 136 bytes ...8ac06ac78bd25e54a66e9c0c934504216a052b8-19 | Bin 0 -> 24 bytes ...a7af838bcc3696442f9b40b748d98ad8d00f010-31 | Bin 0 -> 38 bytes ...bb56cde1f1c75c59be249206d096bcabb399058-21 | Bin 0 -> 76 bytes ...ed4b450a8b71a5109a704905a76a2da2d7dfe49-34 | Bin 0 -> 136 bytes ...f4df404090795fde8d4c04be615490db7116a59-31 | Bin 0 -> 46 bytes ...80dcd9fc610d92ac8bba335d2f6e179d5e749d8-28 | Bin 0 -> 54 bytes ...8ccba1d386f3cd66c7358ca23496fa32473d57c-20 | Bin 0 -> 36 bytes ...956a974bdcb6ebec1fbeffb085749e3b3a487f3-28 | Bin 0 -> 54 bytes ...9badd719266d2a3bc4be9de5c59fc44af8ff780-40 | Bin 0 -> 124 bytes ...c15eaef07bac5ede993be4397122f96c5feec39-23 | Bin 0 -> 64 bytes ...e734911456eedbc53705c01bb915e5353d74f03-23 | Bin 0 -> 64 bytes ...f850616519e16915c1dab7c5deb20b1e51f8ea9-31 | Bin 0 -> 86 bytes ...1cca47e3c6d6e4385d701423b9a4e85dfd15d4f-29 | Bin 0 -> 22 bytes ...29872b5cdd49978daa54cdefdabfe0268b8d478-23 | Bin 0 -> 32 bytes ...42766049d46e681c63bbc4d5b4e9392d4c43b54-18 | Bin 0 -> 32 bytes ...4f2feabf9e90089e2ef2775a97cae38cb7488ca-25 | Bin 0 -> 46 bytes ...6de4d9c5c7c14b1e490af56453644b79289edd3-24 | Bin 0 -> 76 bytes ...6f8b664b70a086fabf87e252c741b4889246614-21 | Bin 0 -> 32 bytes ...8c78ce44d250413d84ea218ffc239d6ca62a4b2-25 | Bin 0 -> 96 bytes ...a8357ec5c3c47d9673643cd1b4fec456ad126cc-32 | Bin 0 -> 78 bytes ...b900dc25ddf84b33d1ed3271e7d63392ba8ad30-44 | Bin 0 -> 124 bytes ...c2b6fc0145ce544f3499d2b363a7fa7bb854070-44 | Bin 0 -> 172 bytes ...c56faeb21367eea8cb095113154ef2eb84f56b1-21 | Bin 0 -> 49 bytes ...dc804094e87f6b4f4ecc64044c90e357dc3d899-29 | Bin 0 -> 46 bytes ...f3777f9fb20e80d248a09df6becc4005c4bbaeb-32 | Bin 0 -> 104 bytes ...1d8abacc9231252a1dbae4360b50ca83ba16c91-21 | Bin 0 -> 32 bytes ...22bba725e7e27c415a5877d2d209cfb3261ee31-34 | Bin 0 -> 78 bytes ...23d1be339e809c99fcf816070fa6054611bcb3d-22 | Bin 0 -> 148 bytes ...2b896de861d497724c9ab253b788012c88a0078-19 | Bin 0 -> 36 bytes ...48363a070ba86560a993d75f5a70ffb42c4fe5d-39 | Bin 0 -> 116 bytes ...48f59f25dd2f392ab730be4ca77fe3f36a5d0fe-25 | Bin 0 -> 54 bytes ...555f6a95de2314adbb8955c375fdd963d44ee4c-22 | Bin 0 -> 32 bytes ...5f33316b988555329b5175b1f494cbc8f10a95d-22 | Bin 0 -> 30 bytes ...81ba81b7f6503269f8603a90d5018e2cdf7742d-30 | Bin 0 -> 30 bytes ...8fdec5757bdc33a345cf2fb70087d319ca69df3-30 | Bin 0 -> 64 bytes ...b5c1585e2215377a13de0476aebb25ada34121e-26 | Bin 0 -> 32 bytes ...d0430d44fadfa89d73184a88ce6c629905e88ad-26 | Bin 0 -> 54 bytes ...0a02e6295ff12126e32881c95738df285904a5a-33 | Bin 0 -> 54 bytes ...0bd5f6e469b36da15328481ae25fbafebd32da6-24 | Bin 0 -> 96 bytes ...2dbcc070bfd0955c2e576bfe3e54add4467614a-24 | Bin 0 -> 40 bytes ...366539aa2e3ba586ec3e0cc08d12aff0f884f12-29 | Bin 0 -> 62 bytes ...61196e3c7fe954a5af83b57e70983630a7853c2-34 | Bin 0 -> 262 bytes ...70c4e8e3c3c12755884604cddb8923dc1ab37e1-27 | Bin 0 -> 62 bytes ...94e8d71c7563a0393b79faa8ab0cfaf5bc4a54d-29 | Bin 0 -> 150 bytes ...9a27a580f70c99fbda354237a9ce0455f784729-43 | Bin 0 -> 148 bytes ...a0d7b4c4393b074f65d438e00e3ee9c2d2dcd3a-27 | Bin 0 -> 54 bytes ...e23e4bf112063d0c37a109e08fd1b601f15c628-28 | Bin 0 -> 46 bytes ...1318d5938e840d21474d7bea49d7bedfde29b83-31 | Bin 0 -> 80 bytes ...22dccbf890ae7f21063096d5eea83a028a537dd-38 | Bin 0 -> 116 bytes ...39146662e22c90a94d9d3d1a26fb3adf153a201-23 | Bin 0 -> 38 bytes ...5dc278a49a9c8b2e435098aac3f3738c3a094d9-36 | Bin 0 -> 16 bytes ...6f1c7684cd7c75946874fdbdc2465f89d18a5dc-20 | Bin 0 -> 32 bytes ...92b57a81d0abfe9e4b8776eeecf40d7911b47ad-43 | Bin 0 -> 132 bytes ...9479959f9f5d29f6c968ac082feee48d466615c-22 | Bin 0 -> 56 bytes ...a84edd9832c0bc796b635427cce3ccc484e3e2d-28 | Bin 0 -> 48 bytes ...afda136beeb06d713e259a759ed922943e47a98-21 | Bin 0 -> 38 bytes ...f89d5aded6c91371c7ae1e9eaec66bce15f9619-28 | Bin 0 -> 14 bytes ...054923406767f563122be017a7152a8bae0cb36-21 | Bin 0 -> 56 bytes ...0b283cbc4963b3ced880d2a1846f004012752b5-37 | Bin 0 -> 116 bytes ...14cea43a75816f5b2d3a702922227d75d7d071e-30 | Bin 0 -> 30 bytes ...3c49acc7b96c5496d4cf98534744f46e02551c1-28 | Bin 0 -> 22 bytes ...3ea979e46d363495c225e979f409143bc55722a-24 | Bin 0 -> 176 bytes ...43e85424fb7f6667186c9f1b9f70c10ba747d6d-21 | Bin 0 -> 32 bytes ...4ac4d9601af6baf58547777fb497b42ede30f88-27 | Bin 0 -> 38 bytes ...8e417c9fbc9e87a6574803dee65eb0e2bd0f8e8-29 | Bin 0 -> 22 bytes ...95a7e045ba15261a8b49ed1cce8ee29dc082350-22 | Bin 0 -> 48 bytes ...d652f035e1cb3597ce0f08f9806d4808b0c1282-29 | Bin 0 -> 56 bytes ...f7ca45bc4f49b10ec51e2811d9fb6f1902ba785-32 | Bin 0 -> 78 bytes ...5056e6758eb8ef28caa7581d86343753e9f45c6-20 | Bin 0 -> 36 bytes ...57cabea075db52c9ccce920d377d27738adcec3-22 | Bin 0 -> 116 bytes ...7d2994562664f6bf0cbe35073d526aad8d0fa61-26 | Bin 0 -> 168 bytes ...d133173cef3960a8183e8c8b2f95d2b004e7cfb-27 | Bin 0 -> 14 bytes ...064b4dad114fdedf6621d36000f00f812048439-22 | Bin 0 -> 24 bytes ...1261faaf54bf23f25d249189bf9a582dfaa64fe-22 | Bin 0 -> 28 bytes ...3dc2567dc9e9cbf1e5050fd95d6f9a5ac21fa1b-33 | Bin 0 -> 144 bytes ...5525a678cc77a909ac2c370db1083dba484ce4f-35 | Bin 0 -> 88 bytes ...58ac5d0464b542490eb0e7b5ce3fcc805b811c5-39 | Bin 0 -> 124 bytes ...662b14e9c7f52333d6008f4e783c4c0cf4d0f77-42 | Bin 0 -> 140 bytes ...6ca40af244ed4652f3a9143c6477f8a77e0531d-23 | Bin 0 -> 24 bytes ...70545ce4d6cc514719f235496ac21fa7f21a804-25 | Bin 0 -> 46 bytes ...8ca06862f5ba07446b65acce33fdb1e0ea2eb48-42 | Bin 0 -> 132 bytes ...ccec1effec1c29c8a6302750a3b454cf102fbff-21 | Bin 0 -> 40 bytes ...093e389660c78c3a71936a2ff33c5e2fa76e418-27 | Bin 0 -> 40 bytes ...4e3849ea4027af4efd9bb663e6feb781d453564-27 | Bin 0 -> 94 bytes ...67fae5bc9da5fa322e96d74c3777fee64e9aa71-24 | Bin 0 -> 48 bytes ...71a5ed72601cb5503078ca7bd6befef392b262c-35 | Bin 0 -> 40 bytes ...aa6ae574c0ceba20f66f8e90800f7d7c574ee3f-35 | Bin 0 -> 24 bytes ...c8f746114350fdb214b3666e07d9c0f7df5494f-20 | Bin 0 -> 40 bytes ...d97bcb74c32d6620bdc39370304fdc8f1494636-23 | Bin 0 -> 64 bytes ...2c29cc7b65b833b1635b59ee2fcd03456750945-22 | Bin 0 -> 56 bytes ...50b2ac912b222308d7ecacb803515f1358c31bb-38 | Bin 0 -> 116 bytes ...8ac547e32935f2c96434cc8f6181c1ddece6b6d-24 | Bin 0 -> 68 bytes ...8fe5f9e5c1c6a5659f354f660aa44722a9473f3-20 | Bin 0 -> 36 bytes ...9229ce6b5518054c6d1f07170f02c10b246456f-30 | Bin 0 -> 174 bytes ...c250e6c88ea13850c46f40da69bf60cdac1fcee-34 | Bin 0 -> 152 bytes ...da17ae328d282daeeb2560f85d818e7d15bc7fa-21 | Bin 0 -> 48 bytes ...09de1dd7890e4f2ec9aea376a60d7ea515dd863-36 | Bin 0 -> 40 bytes ...4717fa8767291362425aed782add48fe20ee660-19 | Bin 0 -> 32 bytes ...69b96f326099aec6214f598cace50b87e70c3c5-23 | Bin 0 -> 48 bytes ...8345836c6d78aaa4587fff9e8b6999e7fbc1fba-33 | Bin 0 -> 150 bytes ...901aa980913cd07c6bc22c98f5d8f99b444fc09-26 | Bin 0 -> 54 bytes ...fa9c9f38ebd3b5a819b7045469c41fd0aa9ae2b-25 | Bin 0 -> 322 bytes ...80c40bf0204735918c77b5915c50627373cd065-33 | Bin 0 -> 85 bytes ...dbf03c9612dae919f161657ab8fcf9df9757613-45 | Bin 0 -> 188 bytes ...dd1365131cb5df3a1e8b345841f8764d899c9a0-32 | Bin 0 -> 46 bytes ...1f5e15288f6686d97416661d18c132603f6c6be-24 | Bin 0 -> 62 bytes ...36a6aaef9a37903ee9511da23f34816fa0031ad-19 | Bin 0 -> 36 bytes ...60c50d6540de0952cdc4f5d242bf79d4efc9dad-20 | Bin 0 -> 32 bytes ...939c0a818825208cdd5059faf39882d8d191521-35 | Bin 0 -> 116 bytes ...c1e7d06459318aa00f16bed7d5be9d5741e6583-42 | Bin 0 -> 132 bytes ...274272ee8782ab1d6fc81176f8f256b609bd503-28 | Bin 0 -> 384 bytes ...38160292314be6db80fe5f02b1559ec5938742d-30 | Bin 0 -> 54 bytes ...580d4062ae40f31a8cf9aefcb2864c404098971-20 | Bin 0 -> 56 bytes ...5c6e7ad0013b963c2c57f8acb8c4acf075a862b-25 | Bin 0 -> 56 bytes ...765277bec807e97640c867e7f0972f1e28f224d-20 | Bin 0 -> 156 bytes ...90b46f333afa8788168a6339db0b91a0257c069-23 | Bin 0 -> 56 bytes ...90dd0883bbf6eb74f1cbfeb8d45858aabac6efb-26 | Bin 0 -> 62 bytes 133 files changed, 302 insertions(+), 408 deletions(-) create mode 100644 endian.go create mode 100644 testdata/corpus/0062276f7138164404d06d2174670196ad862d75-25 create mode 100644 testdata/corpus/01d3ec3c421bf5b9b724960e251c41500ad13acb-41 create mode 100644 testdata/corpus/02f189d9277857267e86c16aa6efecf73a828246-41 create mode 100644 testdata/corpus/051d210d4813c4559f3ba2a14d7f3c92382aeb19-32 create mode 100644 testdata/corpus/05dfdc3a5f0c02497c82df67ab5201f90deb53e0-30 create mode 100644 testdata/corpus/06e0230b9a33c22d5ac2528f70f272fb4f562b35-25 create mode 100644 testdata/corpus/074da7dda3821705debb429b28b0b62cc1eaaace-28 create mode 100644 testdata/corpus/07d9be705d50f0432fcb33b20ebcbcfa30e4f2a9-26 create mode 100644 testdata/corpus/08ac06ac78bd25e54a66e9c0c934504216a052b8-19 create mode 100644 testdata/corpus/0a7af838bcc3696442f9b40b748d98ad8d00f010-31 create mode 100644 testdata/corpus/0bb56cde1f1c75c59be249206d096bcabb399058-21 create mode 100644 testdata/corpus/0ed4b450a8b71a5109a704905a76a2da2d7dfe49-34 create mode 100644 testdata/corpus/0f4df404090795fde8d4c04be615490db7116a59-31 create mode 100644 testdata/corpus/180dcd9fc610d92ac8bba335d2f6e179d5e749d8-28 create mode 100644 testdata/corpus/18ccba1d386f3cd66c7358ca23496fa32473d57c-20 create mode 100644 testdata/corpus/1956a974bdcb6ebec1fbeffb085749e3b3a487f3-28 create mode 100644 testdata/corpus/19badd719266d2a3bc4be9de5c59fc44af8ff780-40 create mode 100644 testdata/corpus/1c15eaef07bac5ede993be4397122f96c5feec39-23 create mode 100644 testdata/corpus/2e734911456eedbc53705c01bb915e5353d74f03-23 create mode 100644 testdata/corpus/2f850616519e16915c1dab7c5deb20b1e51f8ea9-31 create mode 100644 testdata/corpus/31cca47e3c6d6e4385d701423b9a4e85dfd15d4f-29 create mode 100644 testdata/corpus/329872b5cdd49978daa54cdefdabfe0268b8d478-23 create mode 100644 testdata/corpus/342766049d46e681c63bbc4d5b4e9392d4c43b54-18 create mode 100644 testdata/corpus/34f2feabf9e90089e2ef2775a97cae38cb7488ca-25 create mode 100644 testdata/corpus/36de4d9c5c7c14b1e490af56453644b79289edd3-24 create mode 100644 testdata/corpus/36f8b664b70a086fabf87e252c741b4889246614-21 create mode 100644 testdata/corpus/38c78ce44d250413d84ea218ffc239d6ca62a4b2-25 create mode 100644 testdata/corpus/3a8357ec5c3c47d9673643cd1b4fec456ad126cc-32 create mode 100644 testdata/corpus/3b900dc25ddf84b33d1ed3271e7d63392ba8ad30-44 create mode 100644 testdata/corpus/3c2b6fc0145ce544f3499d2b363a7fa7bb854070-44 create mode 100644 testdata/corpus/3c56faeb21367eea8cb095113154ef2eb84f56b1-21 create mode 100644 testdata/corpus/3dc804094e87f6b4f4ecc64044c90e357dc3d899-29 create mode 100644 testdata/corpus/3f3777f9fb20e80d248a09df6becc4005c4bbaeb-32 create mode 100644 testdata/corpus/41d8abacc9231252a1dbae4360b50ca83ba16c91-21 create mode 100644 testdata/corpus/422bba725e7e27c415a5877d2d209cfb3261ee31-34 create mode 100644 testdata/corpus/423d1be339e809c99fcf816070fa6054611bcb3d-22 create mode 100644 testdata/corpus/42b896de861d497724c9ab253b788012c88a0078-19 create mode 100644 testdata/corpus/448363a070ba86560a993d75f5a70ffb42c4fe5d-39 create mode 100644 testdata/corpus/448f59f25dd2f392ab730be4ca77fe3f36a5d0fe-25 create mode 100644 testdata/corpus/4555f6a95de2314adbb8955c375fdd963d44ee4c-22 create mode 100644 testdata/corpus/45f33316b988555329b5175b1f494cbc8f10a95d-22 create mode 100644 testdata/corpus/481ba81b7f6503269f8603a90d5018e2cdf7742d-30 create mode 100644 testdata/corpus/48fdec5757bdc33a345cf2fb70087d319ca69df3-30 create mode 100644 testdata/corpus/4b5c1585e2215377a13de0476aebb25ada34121e-26 create mode 100644 testdata/corpus/4d0430d44fadfa89d73184a88ce6c629905e88ad-26 create mode 100644 testdata/corpus/50a02e6295ff12126e32881c95738df285904a5a-33 create mode 100644 testdata/corpus/50bd5f6e469b36da15328481ae25fbafebd32da6-24 create mode 100644 testdata/corpus/52dbcc070bfd0955c2e576bfe3e54add4467614a-24 create mode 100644 testdata/corpus/5366539aa2e3ba586ec3e0cc08d12aff0f884f12-29 create mode 100644 testdata/corpus/561196e3c7fe954a5af83b57e70983630a7853c2-34 create mode 100644 testdata/corpus/570c4e8e3c3c12755884604cddb8923dc1ab37e1-27 create mode 100644 testdata/corpus/594e8d71c7563a0393b79faa8ab0cfaf5bc4a54d-29 create mode 100644 testdata/corpus/59a27a580f70c99fbda354237a9ce0455f784729-43 create mode 100644 testdata/corpus/5a0d7b4c4393b074f65d438e00e3ee9c2d2dcd3a-27 create mode 100644 testdata/corpus/5e23e4bf112063d0c37a109e08fd1b601f15c628-28 create mode 100644 testdata/corpus/61318d5938e840d21474d7bea49d7bedfde29b83-31 create mode 100644 testdata/corpus/622dccbf890ae7f21063096d5eea83a028a537dd-38 create mode 100644 testdata/corpus/639146662e22c90a94d9d3d1a26fb3adf153a201-23 create mode 100644 testdata/corpus/65dc278a49a9c8b2e435098aac3f3738c3a094d9-36 create mode 100644 testdata/corpus/66f1c7684cd7c75946874fdbdc2465f89d18a5dc-20 create mode 100644 testdata/corpus/692b57a81d0abfe9e4b8776eeecf40d7911b47ad-43 create mode 100644 testdata/corpus/69479959f9f5d29f6c968ac082feee48d466615c-22 create mode 100644 testdata/corpus/6a84edd9832c0bc796b635427cce3ccc484e3e2d-28 create mode 100644 testdata/corpus/6afda136beeb06d713e259a759ed922943e47a98-21 create mode 100644 testdata/corpus/6f89d5aded6c91371c7ae1e9eaec66bce15f9619-28 create mode 100644 testdata/corpus/7054923406767f563122be017a7152a8bae0cb36-21 create mode 100644 testdata/corpus/70b283cbc4963b3ced880d2a1846f004012752b5-37 create mode 100644 testdata/corpus/714cea43a75816f5b2d3a702922227d75d7d071e-30 create mode 100644 testdata/corpus/73c49acc7b96c5496d4cf98534744f46e02551c1-28 create mode 100644 testdata/corpus/73ea979e46d363495c225e979f409143bc55722a-24 create mode 100644 testdata/corpus/743e85424fb7f6667186c9f1b9f70c10ba747d6d-21 create mode 100644 testdata/corpus/74ac4d9601af6baf58547777fb497b42ede30f88-27 create mode 100644 testdata/corpus/78e417c9fbc9e87a6574803dee65eb0e2bd0f8e8-29 create mode 100644 testdata/corpus/795a7e045ba15261a8b49ed1cce8ee29dc082350-22 create mode 100644 testdata/corpus/7d652f035e1cb3597ce0f08f9806d4808b0c1282-29 create mode 100644 testdata/corpus/7f7ca45bc4f49b10ec51e2811d9fb6f1902ba785-32 create mode 100644 testdata/corpus/85056e6758eb8ef28caa7581d86343753e9f45c6-20 create mode 100644 testdata/corpus/857cabea075db52c9ccce920d377d27738adcec3-22 create mode 100644 testdata/corpus/87d2994562664f6bf0cbe35073d526aad8d0fa61-26 create mode 100644 testdata/corpus/8d133173cef3960a8183e8c8b2f95d2b004e7cfb-27 create mode 100644 testdata/corpus/9064b4dad114fdedf6621d36000f00f812048439-22 create mode 100644 testdata/corpus/91261faaf54bf23f25d249189bf9a582dfaa64fe-22 create mode 100644 testdata/corpus/93dc2567dc9e9cbf1e5050fd95d6f9a5ac21fa1b-33 create mode 100644 testdata/corpus/95525a678cc77a909ac2c370db1083dba484ce4f-35 create mode 100644 testdata/corpus/958ac5d0464b542490eb0e7b5ce3fcc805b811c5-39 create mode 100644 testdata/corpus/9662b14e9c7f52333d6008f4e783c4c0cf4d0f77-42 create mode 100644 testdata/corpus/96ca40af244ed4652f3a9143c6477f8a77e0531d-23 create mode 100644 testdata/corpus/970545ce4d6cc514719f235496ac21fa7f21a804-25 create mode 100644 testdata/corpus/98ca06862f5ba07446b65acce33fdb1e0ea2eb48-42 create mode 100644 testdata/corpus/9ccec1effec1c29c8a6302750a3b454cf102fbff-21 create mode 100644 testdata/corpus/a093e389660c78c3a71936a2ff33c5e2fa76e418-27 create mode 100644 testdata/corpus/a4e3849ea4027af4efd9bb663e6feb781d453564-27 create mode 100644 testdata/corpus/a67fae5bc9da5fa322e96d74c3777fee64e9aa71-24 create mode 100644 testdata/corpus/a71a5ed72601cb5503078ca7bd6befef392b262c-35 create mode 100644 testdata/corpus/aaa6ae574c0ceba20f66f8e90800f7d7c574ee3f-35 create mode 100644 testdata/corpus/ac8f746114350fdb214b3666e07d9c0f7df5494f-20 create mode 100644 testdata/corpus/ad97bcb74c32d6620bdc39370304fdc8f1494636-23 create mode 100644 testdata/corpus/b2c29cc7b65b833b1635b59ee2fcd03456750945-22 create mode 100644 testdata/corpus/b50b2ac912b222308d7ecacb803515f1358c31bb-38 create mode 100644 testdata/corpus/b8ac547e32935f2c96434cc8f6181c1ddece6b6d-24 create mode 100644 testdata/corpus/b8fe5f9e5c1c6a5659f354f660aa44722a9473f3-20 create mode 100644 testdata/corpus/b9229ce6b5518054c6d1f07170f02c10b246456f-30 create mode 100644 testdata/corpus/bc250e6c88ea13850c46f40da69bf60cdac1fcee-34 create mode 100644 testdata/corpus/bda17ae328d282daeeb2560f85d818e7d15bc7fa-21 create mode 100644 testdata/corpus/c09de1dd7890e4f2ec9aea376a60d7ea515dd863-36 create mode 100644 testdata/corpus/c4717fa8767291362425aed782add48fe20ee660-19 create mode 100644 testdata/corpus/c69b96f326099aec6214f598cace50b87e70c3c5-23 create mode 100644 testdata/corpus/c8345836c6d78aaa4587fff9e8b6999e7fbc1fba-33 create mode 100644 testdata/corpus/c901aa980913cd07c6bc22c98f5d8f99b444fc09-26 create mode 100644 testdata/corpus/cfa9c9f38ebd3b5a819b7045469c41fd0aa9ae2b-25 create mode 100644 testdata/corpus/d80c40bf0204735918c77b5915c50627373cd065-33 create mode 100644 testdata/corpus/ddbf03c9612dae919f161657ab8fcf9df9757613-45 create mode 100644 testdata/corpus/ddd1365131cb5df3a1e8b345841f8764d899c9a0-32 create mode 100644 testdata/corpus/e1f5e15288f6686d97416661d18c132603f6c6be-24 create mode 100644 testdata/corpus/e36a6aaef9a37903ee9511da23f34816fa0031ad-19 create mode 100644 testdata/corpus/e60c50d6540de0952cdc4f5d242bf79d4efc9dad-20 create mode 100644 testdata/corpus/e939c0a818825208cdd5059faf39882d8d191521-35 create mode 100644 testdata/corpus/ec1e7d06459318aa00f16bed7d5be9d5741e6583-42 create mode 100644 testdata/corpus/f274272ee8782ab1d6fc81176f8f256b609bd503-28 create mode 100644 testdata/corpus/f38160292314be6db80fe5f02b1559ec5938742d-30 create mode 100644 testdata/corpus/f580d4062ae40f31a8cf9aefcb2864c404098971-20 create mode 100644 testdata/corpus/f5c6e7ad0013b963c2c57f8acb8c4acf075a862b-25 create mode 100644 testdata/corpus/f765277bec807e97640c867e7f0972f1e28f224d-20 create mode 100644 testdata/corpus/f90b46f333afa8788168a6339db0b91a0257c069-23 create mode 100644 testdata/corpus/f90dd0883bbf6eb74f1cbfeb8d45858aabac6efb-26 diff --git a/address.go b/address.go index 0b97104..1012098 100644 --- a/address.go +++ b/address.go @@ -6,7 +6,6 @@ import ( "net" "github.com/mdlayher/netlink" - "github.com/mdlayher/netlink/nlenc" "golang.org/x/sys/unix" ) @@ -49,9 +48,16 @@ func (m *AddressMessage) MarshalBinary() ([]byte, error) { b[1] = m.PrefixLength b[2] = m.Flags b[3] = m.Scope - nlenc.PutUint32(b[4:8], m.Index) + nativeEndian.PutUint32(b[4:8], m.Index) - a, err := m.Attributes.MarshalBinary() + ae := netlink.NewAttributeEncoder() + ae.ByteOrder = nativeEndian + err := m.Attributes.encode(ae) + if err != nil { + return nil, err + } + + a, err := ae.Encode() if err != nil { return nil, err } @@ -70,11 +76,16 @@ func (m *AddressMessage) UnmarshalBinary(b []byte) error { m.PrefixLength = uint8(b[1]) m.Flags = uint8(b[2]) m.Scope = uint8(b[3]) - m.Index = nlenc.Uint32(b[4:8]) + m.Index = nativeEndian.Uint32(b[4:8]) if l > unix.SizeofIfAddrmsg { m.Attributes = AddressAttributes{} - err := m.Attributes.UnmarshalBinary(b[unix.SizeofIfAddrmsg:]) + ad, err := netlink.NewAttributeDecoder(b[unix.SizeofIfAddrmsg:]) + if err != nil { + return err + } + ad.ByteOrder = nativeEndian + err = m.Attributes.decode(ad) if err != nil { return err } @@ -143,99 +154,74 @@ type AddressAttributes struct { Flags uint32 // Address flags } -// UnmarshalBinary unmarshals the contents of a byte slice into a AddressMessage. -func (a *AddressAttributes) UnmarshalBinary(b []byte) error { - attrs, err := netlink.UnmarshalAttributes(b) - if err != nil { - return err - } - for _, attr := range attrs { - switch attr.Type { +func (a *AddressAttributes) decode(ad *netlink.AttributeDecoder) error { + + for ad.Next() { + switch ad.Type() { case unix.IFA_UNSPEC: - //unused attribute + // unused attribute case unix.IFA_ADDRESS: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidAddressMessageAttr } - a.Address = attr.Data + a.Address = ad.Bytes() case unix.IFA_LOCAL: - if len(attr.Data) != 4 { + if len(ad.Bytes()) != 4 { return errInvalidAddressMessageAttr } - a.Local = attr.Data + a.Local = ad.Bytes() case unix.IFA_LABEL: - a.Label = nlenc.String(attr.Data) + a.Label = ad.String() case unix.IFA_BROADCAST: - if len(attr.Data) != 4 { + if len(ad.Bytes()) != 4 { return errInvalidAddressMessageAttr } - a.Broadcast = attr.Data + a.Broadcast = ad.Bytes() case unix.IFA_ANYCAST: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidAddressMessageAttr } - a.Anycast = attr.Data + a.Anycast = ad.Bytes() case unix.IFA_CACHEINFO: - if len(attr.Data) != 16 { + if len(ad.Bytes()) != 16 { return errInvalidAddressMessageAttr } - err := a.CacheInfo.UnmarshalBinary(attr.Data) + err := a.CacheInfo.unmarshalBinary(ad.Bytes()) if err != nil { return err } case unix.IFA_MULTICAST: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidAddressMessageAttr } - a.Multicast = attr.Data + a.Multicast = ad.Bytes() case unix.IFA_FLAGS: - if len(attr.Data) != 4 { + if len(ad.Bytes()) != 4 { return errInvalidAddressMessageAttr } - a.Flags = nlenc.Uint32(attr.Data) + a.Flags = ad.Uint32() } } return nil } -// MarshalBinary marshals a AddressAttributes into a byte slice. -func (a *AddressAttributes) MarshalBinary() ([]byte, error) { - attrs := []netlink.Attribute{ - { - Type: unix.IFA_UNSPEC, - Data: nlenc.Uint16Bytes(0), - }, - { - Type: unix.IFA_ADDRESS, - Data: a.Address, - }, - { - Type: unix.IFA_BROADCAST, - Data: a.Broadcast, - }, - { - Type: unix.IFA_ANYCAST, - Data: a.Anycast, - }, - { - Type: unix.IFA_MULTICAST, - Data: a.Multicast, - }, - { - Type: unix.IFA_FLAGS, - Data: nlenc.Uint32Bytes(a.Flags), - }, - } +func (a *AddressAttributes) encode(ae *netlink.AttributeEncoder) error { + ae.Uint16(unix.IFA_UNSPEC, 0) + ae.Bytes(unix.IFA_ADDRESS, a.Address) + ae.Bytes(unix.IFA_BROADCAST, a.Broadcast) + ae.Bytes(unix.IFA_ANYCAST, a.Anycast) + ae.Bytes(unix.IFA_MULTICAST, a.Multicast) + ae.Uint32(unix.IFA_FLAGS, a.Flags) if a.Local != nil { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFA_LOCAL, - Data: a.Local, - }) + ae.Bytes(unix.IFA_LOCAL, a.Local) } - return netlink.MarshalAttributes(attrs) + return nil } // CacheInfo contains address information @@ -246,16 +232,16 @@ type CacheInfo struct { Updated uint32 } -// UnmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. -func (c *CacheInfo) UnmarshalBinary(b []byte) error { +// unmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. +func (c *CacheInfo) unmarshalBinary(b []byte) error { if len(b) != 16 { return fmt.Errorf("incorrect size, want: 16, got: %d", len(b)) } - c.Prefered = nlenc.Uint32(b[0:4]) - c.Valid = nlenc.Uint32(b[4:8]) - c.Created = nlenc.Uint32(b[8:12]) - c.Updated = nlenc.Uint32(b[12:16]) + c.Prefered = nativeEndian.Uint32(b[0:4]) + c.Valid = nativeEndian.Uint32(b[4:8]) + c.Created = nativeEndian.Uint32(b[8:12]) + c.Updated = nativeEndian.Uint32(b[12:16]) return nil } diff --git a/endian.go b/endian.go new file mode 100644 index 0000000..14193d5 --- /dev/null +++ b/endian.go @@ -0,0 +1,13 @@ +package rtnetlink + +import ( + "encoding/binary" + + "github.com/mdlayher/netlink/nlenc" +) + +var nativeEndian binary.ByteOrder + +func init() { + nativeEndian = nlenc.NativeEndian() +} diff --git a/go.mod b/go.mod index b285152..257e75f 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,7 @@ module github.com/jsimonetti/rtnetlink go 1.12 require ( - github.com/dvyukov/go-fuzz v0.0.0-20191007191509-7002bfe060a6 // indirect - github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect - github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225 - github.com/stephens2424/writerset v1.0.2 // indirect - golang.org/x/sys v0.0.0-20190411185658-b44545bcd369 - golang.org/x/tools v0.0.0-20191007185444-6536af71d98a // indirect + github.com/mdlayher/netlink v0.0.0-20191008140946-2a17fd90af51 + golang.org/x/net v0.0.0-20191007182048-72f939374954 // indirect + golang.org/x/sys v0.0.0-20191008105621-543471e840be ) diff --git a/go.sum b/go.sum index 3cdd7bc..a32f932 100644 --- a/go.sum +++ b/go.sum @@ -1,31 +1,26 @@ -github.com/Julusian/godocdown v0.0.0-20170816220326-6d19f8ff2df8/go.mod h1:INZr5t32rG59/5xeltqoCJoNY7e5x/3xoY9WSWVWg74= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dvyukov/go-fuzz v0.0.0-20191007191509-7002bfe060a6 h1:O02wb/njBnaCguhlHO/qh1aF8F0KhMCy9OUiEybe7NE= -github.com/dvyukov/go-fuzz v0.0.0-20191007191509-7002bfe060a6/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= -github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= -github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225 h1:CxV4h424xakl+HjTCCwbXmDK8Qu/w+rRl2+cw1HDZyM= github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/robertkrimen/godocdown v0.0.0-20130622164427-0bfa04905481/go.mod h1:C9WhFzY47SzYBIvzFqSvHIR6ROgDo4TtdTuRaOMjF/s= -github.com/stephens2424/writerset v1.0.2 h1:znRLgU6g8RS5euYRcy004XeE4W+Tu44kALzy7ghPif8= -github.com/stephens2424/writerset v1.0.2/go.mod h1:aS2JhsMn6eA7e82oNmW4rfsgAOp9COBTTl8mzkwADnc= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/mdlayher/netlink v0.0.0-20191008140946-2a17fd90af51 h1:rP02cBlv8sk9kC1iRINOapZNB9B5S6JChwmYXDiFKpU= +github.com/mdlayher/netlink v0.0.0-20191008140946-2a17fd90af51/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191007182048-72f939374954 h1:JGZucVF/L/TotR719NbujzadOZ2AgnYlqphQGHDCKaU= +golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190411185658-b44545bcd369 h1:aBlRBZoCuZNRDClvfkDoklQqdLzBaA3uViASg2z2p24= golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20191007185444-6536af71d98a h1:mtF1GhqcFEC1RVSQxvgrZWOM22dax6fiM9VfcQoTv6U= -golang.org/x/tools v0.0.0-20191007185444-6536af71d98a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/link.go b/link.go index 62d3447..be2bed9 100644 --- a/link.go +++ b/link.go @@ -6,7 +6,6 @@ import ( "net" "github.com/mdlayher/netlink" - "github.com/mdlayher/netlink/nlenc" "golang.org/x/sys/unix" ) @@ -47,15 +46,22 @@ type LinkMessage struct { func (m *LinkMessage) MarshalBinary() ([]byte, error) { b := make([]byte, unix.SizeofIfInfomsg) - b[0] = 0 //Family - b[1] = 0 //reserved - nlenc.PutUint16(b[2:4], m.Type) - nlenc.PutUint32(b[4:8], m.Index) - nlenc.PutUint32(b[8:12], m.Flags) - nlenc.PutUint32(b[12:16], m.Change) + b[0] = 0 // Family + b[1] = 0 // reserved + nativeEndian.PutUint16(b[2:4], m.Type) + nativeEndian.PutUint32(b[4:8], m.Index) + nativeEndian.PutUint32(b[8:12], m.Flags) + nativeEndian.PutUint32(b[12:16], m.Change) if m.Attributes != nil { - a, err := m.Attributes.MarshalBinary() + ae := netlink.NewAttributeEncoder() + ae.ByteOrder = nativeEndian + err := m.Attributes.encode(ae) + if err != nil { + return nil, err + } + + a, err := ae.Encode() if err != nil { return nil, err } @@ -73,15 +79,20 @@ func (m *LinkMessage) UnmarshalBinary(b []byte) error { return errInvalidLinkMessage } - m.Family = nlenc.Uint16(b[0:2]) - m.Type = nlenc.Uint16(b[2:4]) - m.Index = nlenc.Uint32(b[4:8]) - m.Flags = nlenc.Uint32(b[8:12]) - m.Change = nlenc.Uint32(b[12:16]) + m.Family = nativeEndian.Uint16(b[0:2]) + m.Type = nativeEndian.Uint16(b[2:4]) + m.Index = nativeEndian.Uint32(b[4:8]) + m.Flags = nativeEndian.Uint32(b[8:12]) + m.Change = nativeEndian.Uint32(b[12:16]) if l > unix.SizeofIfInfomsg { m.Attributes = &LinkAttributes{} - err := m.Attributes.UnmarshalBinary(b[16:]) + ad, err := netlink.NewAttributeDecoder(b[16:]) + if err != nil { + return err + } + ad.ByteOrder = nativeEndian + err = m.Attributes.decode(ad) if err != nil { return err } @@ -205,71 +216,52 @@ const ( OperStateUp // interface is in a state to send and receive packets ) -// UnmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. -func (a *LinkAttributes) UnmarshalBinary(b []byte) error { - attrs, err := netlink.UnmarshalAttributes(b) - if err != nil { - return err - } +// unmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. +func (a *LinkAttributes) decode(ad *netlink.AttributeDecoder) error { - for _, attr := range attrs { - switch attr.Type { + for ad.Next() { + switch ad.Type() { case unix.IFLA_UNSPEC: - //unused attribute + // unused attribute case unix.IFLA_ADDRESS: - l := len(attr.Data) + l := len(ad.Bytes()) if l < 4 || l > 32 { return errInvalidLinkMessageAttr } - a.Address = attr.Data + a.Address = ad.Bytes() case unix.IFLA_BROADCAST: - l := len(attr.Data) + l := len(ad.Bytes()) if l < 4 || l > 32 { return errInvalidLinkMessageAttr } - a.Broadcast = attr.Data + a.Broadcast = ad.Bytes() case unix.IFLA_IFNAME: - a.Name = nlenc.String(attr.Data) + a.Name = ad.String() case unix.IFLA_MTU: - if len(attr.Data) != 4 { - return errInvalidLinkMessageAttr - } - a.MTU = nlenc.Uint32(attr.Data) + a.MTU = ad.Uint32() case unix.IFLA_LINK: - if len(attr.Data) != 4 { - return errInvalidLinkMessageAttr - } - a.Type = nlenc.Uint32(attr.Data) + a.Type = ad.Uint32() case unix.IFLA_QDISC: - a.QueueDisc = nlenc.String(attr.Data) + a.QueueDisc = ad.String() case unix.IFLA_OPERSTATE: - if len(attr.Data) != 1 { - return errInvalidLinkMessageAttr - } - a.OperationalState = OperationalState(nlenc.Uint8(attr.Data)) + a.OperationalState = OperationalState(ad.Uint8()) case unix.IFLA_STATS: a.Stats = &LinkStats{} - err := a.Stats.UnmarshalBinary(attr.Data) + err := a.Stats.unmarshalBinary(ad.Bytes()) if err != nil { return err } case unix.IFLA_STATS64: a.Stats64 = &LinkStats64{} - err := a.Stats64.UnmarshalBinary(attr.Data) + err := a.Stats64.unmarshalBinary(ad.Bytes()) if err != nil { return err } case unix.IFLA_LINKINFO: a.Info = &LinkInfo{} - err := a.Info.UnmarshalBinary(attr.Data) - if err != nil { - return err - } + ad.Nested(a.Info.decode) case unix.IFLA_MASTER: - if len(attr.Data) != 4 { - return errInvalidLinkMessageAttr - } - v := nlenc.Uint32(attr.Data) + v := ad.Uint32() a.Master = &v } } @@ -278,73 +270,48 @@ func (a *LinkAttributes) UnmarshalBinary(b []byte) error { } // MarshalBinary marshals a LinkAttributes into a byte slice. -func (a *LinkAttributes) MarshalBinary() ([]byte, error) { - attrs := []netlink.Attribute{ - { - Type: unix.IFLA_UNSPEC, - Data: nlenc.Uint16Bytes(0), - }, - { - Type: unix.IFLA_IFNAME, - Data: nlenc.Bytes(a.Name), - }, - { - Type: unix.IFLA_LINK, - Data: nlenc.Uint32Bytes(a.Type), - }, - { - Type: unix.IFLA_QDISC, - Data: nlenc.Bytes(a.QueueDisc), - }, - } +func (a *LinkAttributes) encode(ae *netlink.AttributeEncoder) error { + ae.Uint16(unix.IFLA_UNSPEC, 0) + ae.String(unix.IFLA_IFNAME, a.Name) + ae.Uint32(unix.IFLA_LINK, a.Type) + ae.String(unix.IFLA_QDISC, a.QueueDisc) if a.MTU != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_MTU, - Data: nlenc.Uint32Bytes(a.MTU), - }) + ae.Uint32(unix.IFLA_MTU, a.MTU) } if len(a.Address) != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_ADDRESS, - Data: a.Address, - }) + ae.Bytes(unix.IFLA_ADDRESS, a.Address) } if len(a.Broadcast) != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_BROADCAST, - Data: a.Broadcast, - }) + ae.Bytes(unix.IFLA_BROADCAST, a.Broadcast) } if a.OperationalState != OperStateUnknown { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_OPERSTATE, - Data: nlenc.Uint8Bytes(uint8(a.OperationalState)), - }) + ae.Uint8(unix.IFLA_OPERSTATE, uint8(a.OperationalState)) } if a.Info != nil { - info, err := a.Info.MarshalBinary() + nae := netlink.NewAttributeEncoder() + nae.ByteOrder = ae.ByteOrder + + err := a.Info.encode(nae) if err != nil { - return nil, err + return err } - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_LINKINFO, - Data: info, - }) + b, err := nae.Encode() + if err != nil { + return err + } + ae.Bytes(unix.IFLA_LINKINFO, b) } if a.Master != nil { - attrs = append(attrs, netlink.Attribute{ - Type: unix.IFLA_MASTER, - Data: nlenc.Uint32Bytes(*a.Master), - }) + ae.Uint32(unix.IFLA_MASTER, *a.Master) } - return netlink.MarshalAttributes(attrs) + return nil } // LinkStats contains packet statistics @@ -382,42 +349,42 @@ type LinkStats struct { RXNoHandler uint32 // dropped, no handler found } -// UnmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. -func (a *LinkStats) UnmarshalBinary(b []byte) error { +// unmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. +func (a *LinkStats) unmarshalBinary(b []byte) error { l := len(b) if l != 92 && l != 96 { return fmt.Errorf("incorrect size, want: 92 or 96") } - a.RXPackets = nlenc.Uint32(b[0:4]) - a.TXPackets = nlenc.Uint32(b[4:8]) - a.RXBytes = nlenc.Uint32(b[8:12]) - a.TXBytes = nlenc.Uint32(b[12:16]) - a.RXErrors = nlenc.Uint32(b[16:20]) - a.TXErrors = nlenc.Uint32(b[20:24]) - a.RXDropped = nlenc.Uint32(b[24:28]) - a.TXDropped = nlenc.Uint32(b[28:32]) - a.Multicast = nlenc.Uint32(b[32:36]) - a.Collisions = nlenc.Uint32(b[36:40]) + a.RXPackets = nativeEndian.Uint32(b[0:4]) + a.TXPackets = nativeEndian.Uint32(b[4:8]) + a.RXBytes = nativeEndian.Uint32(b[8:12]) + a.TXBytes = nativeEndian.Uint32(b[12:16]) + a.RXErrors = nativeEndian.Uint32(b[16:20]) + a.TXErrors = nativeEndian.Uint32(b[20:24]) + a.RXDropped = nativeEndian.Uint32(b[24:28]) + a.TXDropped = nativeEndian.Uint32(b[28:32]) + a.Multicast = nativeEndian.Uint32(b[32:36]) + a.Collisions = nativeEndian.Uint32(b[36:40]) - a.RXLengthErrors = nlenc.Uint32(b[40:44]) - a.RXOverErrors = nlenc.Uint32(b[44:48]) - a.RXCRCErrors = nlenc.Uint32(b[48:52]) - a.RXFrameErrors = nlenc.Uint32(b[52:56]) - a.RXFIFOErrors = nlenc.Uint32(b[56:60]) - a.RXMissedErrors = nlenc.Uint32(b[60:64]) + a.RXLengthErrors = nativeEndian.Uint32(b[40:44]) + a.RXOverErrors = nativeEndian.Uint32(b[44:48]) + a.RXCRCErrors = nativeEndian.Uint32(b[48:52]) + a.RXFrameErrors = nativeEndian.Uint32(b[52:56]) + a.RXFIFOErrors = nativeEndian.Uint32(b[56:60]) + a.RXMissedErrors = nativeEndian.Uint32(b[60:64]) - a.TXAbortedErrors = nlenc.Uint32(b[64:68]) - a.TXCarrierErrors = nlenc.Uint32(b[68:72]) - a.TXFIFOErrors = nlenc.Uint32(b[72:76]) - a.TXHeartbeatErrors = nlenc.Uint32(b[76:80]) - a.TXWindowErrors = nlenc.Uint32(b[80:84]) + a.TXAbortedErrors = nativeEndian.Uint32(b[64:68]) + a.TXCarrierErrors = nativeEndian.Uint32(b[68:72]) + a.TXFIFOErrors = nativeEndian.Uint32(b[72:76]) + a.TXHeartbeatErrors = nativeEndian.Uint32(b[76:80]) + a.TXWindowErrors = nativeEndian.Uint32(b[80:84]) - a.RXCompressed = nlenc.Uint32(b[84:88]) - a.TXCompressed = nlenc.Uint32(b[88:92]) + a.RXCompressed = nativeEndian.Uint32(b[84:88]) + a.TXCompressed = nativeEndian.Uint32(b[88:92]) if l == 96 { - a.RXNoHandler = nlenc.Uint32(b[92:96]) + a.RXNoHandler = nativeEndian.Uint32(b[92:96]) } return nil @@ -458,42 +425,42 @@ type LinkStats64 struct { RXNoHandler uint64 // dropped, no handler found } -// UnmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. -func (a *LinkStats64) UnmarshalBinary(b []byte) error { +// unmarshalBinary unmarshals the contents of a byte slice into a LinkMessage. +func (a *LinkStats64) unmarshalBinary(b []byte) error { l := len(b) if l != 184 && l != 192 { return fmt.Errorf("incorrect size, want: 184 or 192") } - a.RXPackets = nlenc.Uint64(b[0:8]) - a.TXPackets = nlenc.Uint64(b[8:16]) - a.RXBytes = nlenc.Uint64(b[16:24]) - a.TXBytes = nlenc.Uint64(b[24:32]) - a.RXErrors = nlenc.Uint64(b[32:40]) - a.TXErrors = nlenc.Uint64(b[40:48]) - a.RXDropped = nlenc.Uint64(b[48:56]) - a.TXDropped = nlenc.Uint64(b[56:64]) - a.Multicast = nlenc.Uint64(b[64:72]) - a.Collisions = nlenc.Uint64(b[72:80]) + a.RXPackets = nativeEndian.Uint64(b[0:8]) + a.TXPackets = nativeEndian.Uint64(b[8:16]) + a.RXBytes = nativeEndian.Uint64(b[16:24]) + a.TXBytes = nativeEndian.Uint64(b[24:32]) + a.RXErrors = nativeEndian.Uint64(b[32:40]) + a.TXErrors = nativeEndian.Uint64(b[40:48]) + a.RXDropped = nativeEndian.Uint64(b[48:56]) + a.TXDropped = nativeEndian.Uint64(b[56:64]) + a.Multicast = nativeEndian.Uint64(b[64:72]) + a.Collisions = nativeEndian.Uint64(b[72:80]) - a.RXLengthErrors = nlenc.Uint64(b[80:88]) - a.RXOverErrors = nlenc.Uint64(b[88:96]) - a.RXCRCErrors = nlenc.Uint64(b[96:104]) - a.RXFrameErrors = nlenc.Uint64(b[104:112]) - a.RXFIFOErrors = nlenc.Uint64(b[112:120]) - a.RXMissedErrors = nlenc.Uint64(b[120:128]) + a.RXLengthErrors = nativeEndian.Uint64(b[80:88]) + a.RXOverErrors = nativeEndian.Uint64(b[88:96]) + a.RXCRCErrors = nativeEndian.Uint64(b[96:104]) + a.RXFrameErrors = nativeEndian.Uint64(b[104:112]) + a.RXFIFOErrors = nativeEndian.Uint64(b[112:120]) + a.RXMissedErrors = nativeEndian.Uint64(b[120:128]) - a.TXAbortedErrors = nlenc.Uint64(b[128:136]) - a.TXCarrierErrors = nlenc.Uint64(b[136:144]) - a.TXFIFOErrors = nlenc.Uint64(b[144:152]) - a.TXHeartbeatErrors = nlenc.Uint64(b[152:160]) - a.TXWindowErrors = nlenc.Uint64(b[160:168]) + a.TXAbortedErrors = nativeEndian.Uint64(b[128:136]) + a.TXCarrierErrors = nativeEndian.Uint64(b[136:144]) + a.TXFIFOErrors = nativeEndian.Uint64(b[144:152]) + a.TXHeartbeatErrors = nativeEndian.Uint64(b[152:160]) + a.TXWindowErrors = nativeEndian.Uint64(b[160:168]) - a.RXCompressed = nlenc.Uint64(b[168:176]) - a.TXCompressed = nlenc.Uint64(b[176:184]) + a.RXCompressed = nativeEndian.Uint64(b[168:176]) + a.TXCompressed = nativeEndian.Uint64(b[176:184]) if l == 192 { - a.RXNoHandler = nlenc.Uint64(b[184:192]) + a.RXNoHandler = nativeEndian.Uint64(b[184:192]) } return nil @@ -507,54 +474,32 @@ type LinkInfo struct { SlaveData []byte // Slave driver specific configuration } -// UnmarshalBinary unmarshals the contents of a byte slice into a LinkInfo. -func (i *LinkInfo) UnmarshalBinary(b []byte) error { - attrs, err := netlink.UnmarshalAttributes(b) - if err != nil { - return err - } +func (i *LinkInfo) decode(ad *netlink.AttributeDecoder) error { - for _, attr := range attrs { - switch attr.Type { + for ad.Next() { + switch ad.Type() { case unix.IFLA_INFO_KIND: - i.Kind = nlenc.String(attr.Data) + i.Kind = ad.String() case unix.IFLA_INFO_SLAVE_KIND: - i.SlaveKind = nlenc.String(attr.Data) + i.SlaveKind = ad.String() case unix.IFLA_INFO_DATA: - i.Data = attr.Data + i.Data = ad.Bytes() case unix.IFLA_INFO_SLAVE_DATA: - i.SlaveData = attr.Data + i.SlaveData = ad.Bytes() } } return nil } -// MarshalBinary marshals a LinkInfo into a byte slice. -func (i *LinkInfo) MarshalBinary() ([]byte, error) { - attrs := []netlink.Attribute{ - { - Type: unix.IFLA_INFO_KIND, - Data: nlenc.Bytes(i.Kind), - }, - { - Type: unix.IFLA_INFO_DATA, - Data: i.Data, - }, - } +func (i *LinkInfo) encode(ae *netlink.AttributeEncoder) error { + ae.String(unix.IFLA_INFO_KIND, i.Kind) + ae.Bytes(unix.IFLA_INFO_DATA, i.Data) if len(i.SlaveData) > 0 { - attrs = append(attrs, - netlink.Attribute{ - Type: unix.IFLA_INFO_SLAVE_KIND, - Data: nlenc.Bytes(i.SlaveKind), - }, - netlink.Attribute{ - Type: unix.IFLA_INFO_SLAVE_DATA, - Data: i.SlaveData, - }, - ) + ae.String(unix.IFLA_INFO_SLAVE_KIND, i.SlaveKind) + ae.Bytes(unix.IFLA_INFO_SLAVE_DATA, i.SlaveData) } - return netlink.MarshalAttributes(attrs) + return nil } diff --git a/link_test.go b/link_test.go index c703ce3..d4f84e2 100644 --- a/link_test.go +++ b/link_test.go @@ -488,7 +488,7 @@ func TestLinkStatsUnmarshalBinary(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { m := &LinkStats{} - err := (m).UnmarshalBinary(tt.b) + err := (m).unmarshalBinary(tt.b) if err != nil { if want, got := fmt.Sprintf("%s", tt.err), fmt.Sprintf("%s", err); want != got { @@ -643,7 +643,7 @@ func TestLinkStats64UnmarshalBinary(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { m := &LinkStats64{} - err := (m).UnmarshalBinary(tt.b) + err := (m).unmarshalBinary(tt.b) if err != nil { if want, got := fmt.Sprintf("%s", tt.err), fmt.Sprintf("%s", err); want != got { diff --git a/neigh.go b/neigh.go index f550071..41172fd 100644 --- a/neigh.go +++ b/neigh.go @@ -6,7 +6,6 @@ import ( "net" "github.com/mdlayher/netlink" - "github.com/mdlayher/netlink/nlenc" "golang.org/x/sys/unix" ) @@ -45,15 +44,22 @@ type NeighMessage struct { func (m *NeighMessage) MarshalBinary() ([]byte, error) { b := make([]byte, unix.SizeofNdMsg) - nlenc.PutUint16(b[0:2], m.Family) + nativeEndian.PutUint16(b[0:2], m.Family) // bytes 3 and 4 are padding - nlenc.PutUint32(b[4:8], m.Index) - nlenc.PutUint16(b[8:10], m.State) + nativeEndian.PutUint32(b[4:8], m.Index) + nativeEndian.PutUint16(b[8:10], m.State) b[10] = m.Flags b[11] = m.Type if m.Attributes != nil { - a, err := m.Attributes.MarshalBinary() + ae := netlink.NewAttributeEncoder() + ae.ByteOrder = nativeEndian + err := m.Attributes.encode(ae) + if err != nil { + return nil, err + } + + a, err := ae.Encode() if err != nil { return nil, err } @@ -70,15 +76,20 @@ func (m *NeighMessage) UnmarshalBinary(b []byte) error { return errInvalidNeighMessage } - m.Family = nlenc.Uint16(b[0:2]) - m.Index = nlenc.Uint32(b[4:8]) - m.State = nlenc.Uint16(b[8:10]) + m.Family = nativeEndian.Uint16(b[0:2]) + m.Index = nativeEndian.Uint32(b[4:8]) + m.State = nativeEndian.Uint16(b[8:10]) m.Flags = b[10] m.Type = b[11] if l > unix.SizeofNdMsg { m.Attributes = &NeighAttributes{} - err := m.Attributes.UnmarshalBinary(b[unix.SizeofNdMsg:]) + ad, err := netlink.NewAttributeDecoder(b[unix.SizeofNdMsg:]) + if err != nil { + return err + } + ad.ByteOrder = nativeEndian + err = m.Attributes.decode(ad) if err != nil { return err } @@ -147,15 +158,15 @@ type NeighCacheInfo struct { } // UnmarshalBinary unmarshals the contents of a byte slice into a NeighMessage. -func (n *NeighCacheInfo) UnmarshalBinary(b []byte) error { +func (n *NeighCacheInfo) unmarshalBinary(b []byte) error { if len(b) != 16 { return fmt.Errorf("incorrect size, want: 16, got: %d", len(b)) } - n.Confirmed = nlenc.Uint32(b[0:4]) - n.Used = nlenc.Uint32(b[4:8]) - n.Updated = nlenc.Uint32(b[8:12]) - n.RefCount = nlenc.Uint32(b[12:16]) + n.Confirmed = nativeEndian.Uint32(b[0:4]) + n.Used = nativeEndian.Uint32(b[4:8]) + n.Updated = nativeEndian.Uint32(b[8:12]) + n.RefCount = nativeEndian.Uint32(b[12:16]) return nil } @@ -168,64 +179,42 @@ type NeighAttributes struct { IfIndex uint32 } -// NeighAttributes unmarshals the contents of a byte slice into a NeighMessage. -func (a *NeighAttributes) UnmarshalBinary(b []byte) error { - attrs, err := netlink.UnmarshalAttributes(b) - if err != nil { - return err - } +func (a *NeighAttributes) decode(ad *netlink.AttributeDecoder) error { - for _, attr := range attrs { - switch attr.Type { + for ad.Next() { + switch ad.Type() { case unix.NDA_UNSPEC: - //unused attribute + // unused attribute case unix.NDA_DST: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidNeighMessageAttr } - a.Address = attr.Data + a.Address = ad.Bytes() case unix.NDA_LLADDR: - if len(attr.Data) != 6 { + if len(ad.Bytes()) != 6 { return errInvalidNeighMessageAttr } - a.LLAddress = attr.Data + a.LLAddress = ad.Bytes() case unix.NDA_CACHEINFO: a.CacheInfo = &NeighCacheInfo{} - err := a.CacheInfo.UnmarshalBinary(attr.Data) + err := a.CacheInfo.unmarshalBinary(ad.Bytes()) if err != nil { return err } case unix.NDA_IFINDEX: - if len(attr.Data) != 4 { - return errInvalidNeighMessageAttr - } - a.IfIndex = nlenc.Uint32(attr.Data) + a.IfIndex = ad.Uint32() } } return nil } -// MarshalBinary marshals a NeighAttributes into a byte slice. -func (a *NeighAttributes) MarshalBinary() ([]byte, error) { - attrs := []netlink.Attribute{ - { - Type: unix.NDA_UNSPEC, - Data: nlenc.Uint16Bytes(0), - }, - { - Type: unix.NDA_DST, - Data: a.Address, - }, - { - Type: unix.NDA_LLADDR, - Data: a.LLAddress, - }, - { - Type: unix.NDA_IFINDEX, - Data: nlenc.Uint32Bytes(a.IfIndex), - }, - } +func (a *NeighAttributes) encode(ae *netlink.AttributeEncoder) error { + ae.Uint16(unix.NDA_UNSPEC, 0) + ae.Bytes(unix.NDA_DST, a.Address) + ae.Bytes(unix.NDA_LLADDR, a.LLAddress) + ae.Uint32(unix.NDA_IFINDEX, a.IfIndex) - return netlink.MarshalAttributes(attrs) + return nil } diff --git a/route.go b/route.go index 5c2e790..ecc5835 100644 --- a/route.go +++ b/route.go @@ -5,7 +5,6 @@ import ( "net" "github.com/mdlayher/netlink" - "github.com/mdlayher/netlink/nlenc" "golang.org/x/sys/unix" ) @@ -44,9 +43,16 @@ func (m *RouteMessage) MarshalBinary() ([]byte, error) { b[5] = m.Protocol b[6] = m.Scope b[7] = m.Type - nlenc.PutUint32(b[8:12], m.Flags) + nativeEndian.PutUint32(b[8:12], m.Flags) - a, err := m.Attributes.MarshalBinary() + ae := netlink.NewAttributeEncoder() + ae.ByteOrder = nativeEndian + err := m.Attributes.encode(ae) + if err != nil { + return nil, err + } + + a, err := ae.Encode() if err != nil { return nil, err } @@ -68,11 +74,16 @@ func (m *RouteMessage) UnmarshalBinary(b []byte) error { m.Protocol = uint8(b[5]) m.Scope = uint8(b[6]) m.Type = uint8(b[7]) - m.Flags = nlenc.Uint32(b[8:12]) + m.Flags = nativeEndian.Uint32(b[8:12]) if l > unix.SizeofRtMsg { m.Attributes = RouteAttributes{} - err := m.Attributes.UnmarshalBinary(b[unix.SizeofRtMsg:]) + ad, err := netlink.NewAttributeDecoder(b[unix.SizeofRtMsg:]) + ad.ByteOrder = nativeEndian + if err != nil { + return err + } + err = m.Attributes.decode(ad) if err != nil { return err } @@ -156,49 +167,38 @@ type RouteAttributes struct { Expires *uint32 } -func (a *RouteAttributes) UnmarshalBinary(b []byte) error { - attrs, err := netlink.UnmarshalAttributes(b) - if err != nil { - return err - } - for _, attr := range attrs { - switch attr.Type { +func (a *RouteAttributes) decode(ad *netlink.AttributeDecoder) error { + + for ad.Next() { + switch ad.Type() { case unix.RTA_UNSPEC: + //unused attribute case unix.RTA_DST: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidRouteMessageAttr } - a.Dst = attr.Data + a.Dst = ad.Bytes() case unix.RTA_PREFSRC: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidRouteMessageAttr } - a.Src = attr.Data + a.Src = ad.Bytes() case unix.RTA_GATEWAY: - if len(attr.Data) != 4 && len(attr.Data) != 16 { + l := len(ad.Bytes()) + if l != 4 && l != 16 { return errInvalidRouteMessageAttr } - a.Gateway = attr.Data + a.Gateway = ad.Bytes() case unix.RTA_OIF: - if len(attr.Data) != 4 { - return errInvalidRouteMessageAttr - } - a.OutIface = nlenc.Uint32(attr.Data) + a.OutIface = ad.Uint32() case unix.RTA_PRIORITY: - if len(attr.Data) != 4 { - return errInvalidRouteMessageAttr - } - a.Priority = nlenc.Uint32(attr.Data) + a.Priority = ad.Uint32() case unix.RTA_TABLE: - if len(attr.Data) != 4 { - return errInvalidRouteMessageAttr - } - a.Table = nlenc.Uint32(attr.Data) + a.Table = ad.Uint32() case unix.RTA_EXPIRES: - if len(attr.Data) != 4 { - return errInvalidRouteMessageAttr - } - timeout := nlenc.Uint32(attr.Data) + timeout := ad.Uint32() a.Expires = &timeout } } @@ -206,84 +206,53 @@ func (a *RouteAttributes) UnmarshalBinary(b []byte) error { return nil } -func (a *RouteAttributes) MarshalBinary() ([]byte, error) { - attrs := make([]netlink.Attribute, 0) +func (a *RouteAttributes) encode(ae *netlink.AttributeEncoder) error { if a.Dst != nil { if ipv4 := a.Dst.To4(); ipv4 == nil { // Dst Addr is IPv6 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_DST, - Data: a.Dst, - }) + ae.Bytes(unix.RTA_DST, a.Dst) } else { // Dst Addr is IPv4 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_DST, - Data: ipv4, - }) + ae.Bytes(unix.RTA_DST, ipv4) } } if a.Src != nil { if ipv4 := a.Src.To4(); ipv4 == nil { // Src Addr is IPv6 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_PREFSRC, - Data: a.Src, - }) + ae.Bytes(unix.RTA_PREFSRC, a.Src) } else { // Src Addr is IPv4 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_PREFSRC, - Data: ipv4, - }) + ae.Bytes(unix.RTA_PREFSRC, ipv4) } } if a.Gateway != nil { if ipv4 := a.Gateway.To4(); ipv4 == nil { // Gateway Addr is IPv6 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_GATEWAY, - Data: a.Gateway, - }) + ae.Bytes(unix.RTA_GATEWAY, a.Gateway) } else { // Gateway Addr is IPv4 - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_GATEWAY, - Data: ipv4, - }) + ae.Bytes(unix.RTA_GATEWAY, ipv4) } } if a.OutIface != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_OIF, - Data: nlenc.Uint32Bytes(a.OutIface), - }) + ae.Uint32(unix.RTA_OIF, a.OutIface) } if a.Priority != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_PRIORITY, - Data: nlenc.Uint32Bytes(a.Priority), - }) + ae.Uint32(unix.RTA_PRIORITY, a.Priority) } if a.Table != 0 { - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_TABLE, - Data: nlenc.Uint32Bytes(a.Table), - }) + ae.Uint32(unix.RTA_TABLE, a.Table) } if a.Expires != nil { - attrs = append(attrs, netlink.Attribute{ - Type: unix.RTA_EXPIRES, - Data: nlenc.Uint32Bytes(*a.Expires), - }) + ae.Uint32(unix.RTA_EXPIRES, *a.Expires) } - return netlink.MarshalAttributes(attrs) + return nil } diff --git a/testdata/corpus/0062276f7138164404d06d2174670196ad862d75-25 b/testdata/corpus/0062276f7138164404d06d2174670196ad862d75-25 new file mode 100644 index 0000000000000000000000000000000000000000..30c663aa331e2e2b57893b2483fe4e9bc6c65ffb GIT binary patch literal 116 zcmdnLH-u#`0|SI)U|At`Nhl>( literal 0 HcmV?d00001 diff --git a/testdata/corpus/01d3ec3c421bf5b9b724960e251c41500ad13acb-41 b/testdata/corpus/01d3ec3c421bf5b9b724960e251c41500ad13acb-41 new file mode 100644 index 0000000000000000000000000000000000000000..27fc83aec7e1b9fd3a35d051b3f3fcc23f80f1f1 GIT binary patch literal 132 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=5m(SAC-r2>~jg8^+ uzWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1jh?FXu32I+&+AblWy!)E|O?kYF{ literal 0 HcmV?d00001 diff --git a/testdata/corpus/02f189d9277857267e86c16aa6efecf73a828246-41 b/testdata/corpus/02f189d9277857267e86c16aa6efecf73a828246-41 new file mode 100644 index 0000000000000000000000000000000000000000..7826ce77ecd80e71d82f673629a49c787851daf2 GIT binary patch literal 124 zcmaFPz|8Ohh*N-=`IS2Z8<76O0HHtcYiQtLFfcSSHZe6bw|KvQFQ28Oy|as}8ymyt iefvLiF#H124L};mX8~#iVHh8c-V9dH%+LT9htL3#>?dmg literal 0 HcmV?d00001 diff --git a/testdata/corpus/051d210d4813c4559f3ba2a14d7f3c92382aeb19-32 b/testdata/corpus/051d210d4813c4559f3ba2a14d7f3c92382aeb19-32 new file mode 100644 index 0000000000000000000000000000000000000000..0bcf223536c490bcbb02b1298340d128c14c62af GIT binary patch literal 142 pcmd;J;ACK7U}j(g;x7!R_JZi?3<4h$Oh63*I%LY0fwRn(f|Me literal 0 HcmV?d00001 diff --git a/testdata/corpus/0bb56cde1f1c75c59be249206d096bcabb399058-21 b/testdata/corpus/0bb56cde1f1c75c59be249206d096bcabb399058-21 new file mode 100644 index 0000000000000000000000000000000000000000..c353909a87a32914405c4c0384373d86580ae158 GIT binary patch literal 76 hcmZQ%aAM?O;9z*ae=h?Fh%m4*G%$d;AuObd0RYI&6c_*i literal 0 HcmV?d00001 diff --git a/testdata/corpus/0ed4b450a8b71a5109a704905a76a2da2d7dfe49-34 b/testdata/corpus/0ed4b450a8b71a5109a704905a76a2da2d7dfe49-34 new file mode 100644 index 0000000000000000000000000000000000000000..8c59ede33a5530895744daeb3d8f1d3d20f27f19 GIT binary patch literal 136 zcmd;J;ACK7U}j(gV&+%wVEPNgsl6cn3k-3H{O5fQ4IDs~K>9N(y&sK_E)U~lssjMw C@hW=& literal 0 HcmV?d00001 diff --git a/testdata/corpus/0f4df404090795fde8d4c04be615490db7116a59-31 b/testdata/corpus/0f4df404090795fde8d4c04be615490db7116a59-31 new file mode 100644 index 0000000000000000000000000000000000000000..5973d55bdd786e685318ecdb7152c6569ffd0a46 GIT binary patch literal 46 WcmZQ$U}iYcz|6n~q^}dAR{;RBeh6y- literal 0 HcmV?d00001 diff --git a/testdata/corpus/180dcd9fc610d92ac8bba335d2f6e179d5e749d8-28 b/testdata/corpus/180dcd9fc610d92ac8bba335d2f6e179d5e749d8-28 new file mode 100644 index 0000000000000000000000000000000000000000..047ac5c6b9d4077408b7902d723d45287a5baee8 GIT binary patch literal 54 scmd;JU}In~RCDBD;ACK7*sz}i$ltGfYA=Xp)IEjH-^<3p%y4Qi01){MMF0Q* literal 0 HcmV?d00001 diff --git a/testdata/corpus/18ccba1d386f3cd66c7358ca23496fa32473d57c-20 b/testdata/corpus/18ccba1d386f3cd66c7358ca23496fa32473d57c-20 new file mode 100644 index 0000000000000000000000000000000000000000..8c8ae48de334edfee8f106364c1cef020c894101 GIT binary patch literal 36 ocmaF+|E}X(1}8=i1`Y-wa1>!+V`yMtc)x#d2+RBZ7eHbR0Mfk*X8-^I literal 0 HcmV?d00001 diff --git a/testdata/corpus/1956a974bdcb6ebec1fbeffb085749e3b3a487f3-28 b/testdata/corpus/1956a974bdcb6ebec1fbeffb085749e3b3a487f3-28 new file mode 100644 index 0000000000000000000000000000000000000000..b20e0f7fa9efdf1e1b0a71a83ff1aa9d4279bc32 GIT binary patch literal 54 wcmd;JU}LCfnCi&Ez{$YEuwg$dkiTE|)Lu3QW`-9GFq#=C%FNIJ<^N#-05RDM=Kufz literal 0 HcmV?d00001 diff --git a/testdata/corpus/19badd719266d2a3bc4be9de5c59fc44af8ff780-40 b/testdata/corpus/19badd719266d2a3bc4be9de5c59fc44af8ff780-40 new file mode 100644 index 0000000000000000000000000000000000000000..9c3a172ebe09f50a38671dc95300fe7671777708 GIT binary patch literal 124 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=Dm(SAC-r2>~jg8^+ hzWqSCUqHIyGY3%DXBMDF5QgzF=>0%-%uw|Z8UPdRCp`cF literal 0 HcmV?d00001 diff --git a/testdata/corpus/1c15eaef07bac5ede993be4397122f96c5feec39-23 b/testdata/corpus/1c15eaef07bac5ede993be4397122f96c5feec39-23 new file mode 100644 index 0000000000000000000000000000000000000000..95d92592a9b9930b2d9300765548c769a32e8668 GIT binary patch literal 64 wcmaFPpqTR0@uy>XHY3CSS3ey&7}ywqpaDdmez*io1Gx~|o~;og59jX%0ACRg6951J literal 0 HcmV?d00001 diff --git a/testdata/corpus/2e734911456eedbc53705c01bb915e5353d74f03-23 b/testdata/corpus/2e734911456eedbc53705c01bb915e5353d74f03-23 new file mode 100644 index 0000000000000000000000000000000000000000..c8949ddda23b4c60401b0e24cc63147dd6f213a8 GIT binary patch literal 64 zcmd;J;9y{3*s!02fsJ9m?y0>Xno;)@g9wmrU|@K^e{TrO`~An?GXMdy7{h*`=t~9$ E00=u1MgRZ+ literal 0 HcmV?d00001 diff --git a/testdata/corpus/2f850616519e16915c1dab7c5deb20b1e51f8ea9-31 b/testdata/corpus/2f850616519e16915c1dab7c5deb20b1e51f8ea9-31 new file mode 100644 index 0000000000000000000000000000000000000000..c58d843321d36da28577b4b63485dbeda04ee96b GIT binary patch literal 86 lcmd;J;ACK7U}j(g;x7!R_JZi?3<4h$Oh63*IxkuD-;Bx literal 0 HcmV?d00001 diff --git a/testdata/corpus/329872b5cdd49978daa54cdefdabfe0268b8d478-23 b/testdata/corpus/329872b5cdd49978daa54cdefdabfe0268b8d478-23 new file mode 100644 index 0000000000000000000000000000000000000000..b60751fea2a653137a819e3b7c004e5e37b58a7b GIT binary patch literal 32 dcmd;JU}M<-ii3dzNHZ`rG=S*O`(X6`y#Q%}2*>~c literal 0 HcmV?d00001 diff --git a/testdata/corpus/342766049d46e681c63bbc4d5b4e9392d4c43b54-18 b/testdata/corpus/342766049d46e681c63bbc4d5b4e9392d4c43b54-18 new file mode 100644 index 0000000000000000000000000000000000000000..3ab97d9e7396b822d0a8999fc018d33412b7030c GIT binary patch literal 32 fcmaFPpeV)g>Zc>7nc)QxgJ|Yg?qK>40|1~W2X_Df literal 0 HcmV?d00001 diff --git a/testdata/corpus/36de4d9c5c7c14b1e490af56453644b79289edd3-24 b/testdata/corpus/36de4d9c5c7c14b1e490af56453644b79289edd3-24 new file mode 100644 index 0000000000000000000000000000000000000000..7eeb0dcbd73e8db5ad34ac8215beea52ef0ee52e GIT binary patch literal 76 xcmZo*V0gcOZwL#JU;qIT1~!HUxY%E~*nS4a5AXK>2P#I0HLw7=J0Rj9g#g%t8F>Hz literal 0 HcmV?d00001 diff --git a/testdata/corpus/36f8b664b70a086fabf87e252c741b4889246614-21 b/testdata/corpus/36f8b664b70a086fabf87e252c741b4889246614-21 new file mode 100644 index 0000000000000000000000000000000000000000..ed37396817d5d2c5e4c5f9341727d08724b18eab GIT binary patch literal 32 icmaFPpeV)g>ZcZc~jg8^+ ozWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1i=>Y1VXKy*U`0QMXuumAu6 literal 0 HcmV?d00001 diff --git a/testdata/corpus/3c2b6fc0145ce544f3499d2b363a7fa7bb854070-44 b/testdata/corpus/3c2b6fc0145ce544f3499d2b363a7fa7bb854070-44 new file mode 100644 index 0000000000000000000000000000000000000000..e6b3e2438e6e485739360efc80b78582f897f891 GIT binary patch literal 172 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=5m(SAC-r2>~jg8^+ zzWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1i=d}fe7pn4Du(ub7~G#4xmrD5tCJ_7*u COgXy% literal 0 HcmV?d00001 diff --git a/testdata/corpus/3c56faeb21367eea8cb095113154ef2eb84f56b1-21 b/testdata/corpus/3c56faeb21367eea8cb095113154ef2eb84f56b1-21 new file mode 100644 index 0000000000000000000000000000000000000000..a0d09482f8b31ecee0a339c0c6eb2f8ce0adf571 GIT binary patch literal 49 ecmdnz@Y9ilfuG^>tDlalKzbh%A0&>>-wyz|KM?c) literal 0 HcmV?d00001 diff --git a/testdata/corpus/3dc804094e87f6b4f4ecc64044c90e357dc3d899-29 b/testdata/corpus/3dc804094e87f6b4f4ecc64044c90e357dc3d899-29 new file mode 100644 index 0000000000000000000000000000000000000000..44076b8b35eea18f3e09155d8bce45ab83da628a GIT binary patch literal 46 jcmd;J;ACK7U}j(g;^_bspHb=kVE*2H4GmCn7>!jOHvIs-^DTb> literal 0 HcmV?d00001 diff --git a/testdata/corpus/41d8abacc9231252a1dbae4360b50ca83ba16c91-21 b/testdata/corpus/41d8abacc9231252a1dbae4360b50ca83ba16c91-21 new file mode 100644 index 0000000000000000000000000000000000000000..5c679e2083623c09b1fd1a603d49111eb5ab30fc GIT binary patch literal 32 gcmd;JU}In~{OQQSz{$YEV8F-$!+V`yMt_yXd<0064e1_%HE literal 0 HcmV?d00001 diff --git a/testdata/corpus/448363a070ba86560a993d75f5a70ffb42c4fe5d-39 b/testdata/corpus/448363a070ba86560a993d75f5a70ffb42c4fe5d-39 new file mode 100644 index 0000000000000000000000000000000000000000..69f83ea0afedaddfb50eae3a17f2ad1d5587273e GIT binary patch literal 116 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=Dm(SAC-r2>~jg8^+ czWtv$7=8ii1|SXMZcH6f^=+ literal 0 HcmV?d00001 diff --git a/testdata/corpus/481ba81b7f6503269f8603a90d5018e2cdf7742d-30 b/testdata/corpus/481ba81b7f6503269f8603a90d5018e2cdf7742d-30 new file mode 100644 index 0000000000000000000000000000000000000000..5b8c96bded83c983d1992c1024cf37c61a812718 GIT binary patch literal 30 bcmZQ$U}kvHz|6n~q_4jM(+$^wYzQ9!R#XOW literal 0 HcmV?d00001 diff --git a/testdata/corpus/48fdec5757bdc33a345cf2fb70087d319ca69df3-30 b/testdata/corpus/48fdec5757bdc33a345cf2fb70087d319ca69df3-30 new file mode 100644 index 0000000000000000000000000000000000000000..10f6026bf10a555dba0f43126b5c735109e8e480 GIT binary patch literal 64 fcmd;JU}M<3uc3hhNPkAqpP_sxy&sL=02c=U*`yfr literal 0 HcmV?d00001 diff --git a/testdata/corpus/4b5c1585e2215377a13de0476aebb25ada34121e-26 b/testdata/corpus/4b5c1585e2215377a13de0476aebb25ada34121e-26 new file mode 100644 index 0000000000000000000000000000000000000000..f126269dff5faa917c12b739b5cae445ba792e71 GIT binary patch literal 32 Zcmd;JU}M<3uc3hhNPkAqpCSDHp8=w*3+w;@ literal 0 HcmV?d00001 diff --git a/testdata/corpus/4d0430d44fadfa89d73184a88ce6c629905e88ad-26 b/testdata/corpus/4d0430d44fadfa89d73184a88ce6c629905e88ad-26 new file mode 100644 index 0000000000000000000000000000000000000000..65443e7d9a34b6c643011acc88d8ac107da02c7c GIT binary patch literal 54 xcmd;JU}In~RCDBD;ACK7*sz}i$ltGfYA+iDGs6oY2GI=+?hGJtMyU871_0zM2{-@% literal 0 HcmV?d00001 diff --git a/testdata/corpus/50a02e6295ff12126e32881c95738df285904a5a-33 b/testdata/corpus/50a02e6295ff12126e32881c95738df285904a5a-33 new file mode 100644 index 0000000000000000000000000000000000000000..6233892c7fa2e52657298a1e8be56ed3d5c7454c GIT binary patch literal 54 mcmWe&U}kvHz|6qLz}#@1p&3LoTz@4B=HCLcA$*uTj1K@U=?kF% literal 0 HcmV?d00001 diff --git a/testdata/corpus/50bd5f6e469b36da15328481ae25fbafebd32da6-24 b/testdata/corpus/50bd5f6e469b36da15328481ae25fbafebd32da6-24 new file mode 100644 index 0000000000000000000000000000000000000000..d4762ebd4c4b12fe02df728974044265d8461317 GIT binary patch literal 96 zcmaFPpqTR0@uy>XHY3CSS3ey&7}ywqpaDdmez*io1G%WQJzFD09aP+&4I+;zz83&< Cx)Rm^ literal 0 HcmV?d00001 diff --git a/testdata/corpus/52dbcc070bfd0955c2e576bfe3e54add4467614a-24 b/testdata/corpus/52dbcc070bfd0955c2e576bfe3e54add4467614a-24 new file mode 100644 index 0000000000000000000000000000000000000000..c6d77f517925a830a8198a56d5b4e373e6264641 GIT binary patch literal 40 dcmd;JU}M<-ii3dzNHZ`rG=S*O`_SqAdjYe{3x@yz literal 0 HcmV?d00001 diff --git a/testdata/corpus/5366539aa2e3ba586ec3e0cc08d12aff0f884f12-29 b/testdata/corpus/5366539aa2e3ba586ec3e0cc08d12aff0f884f12-29 new file mode 100644 index 0000000000000000000000000000000000000000..f1c25d5ec7ca4d655f49b1c3555878fbbc08fe19 GIT binary patch literal 62 zcmd;JU}LCfnCi&Ez{$YEuwg$dkiTD-aW5MKGeZNzDKPzl;ZzEU{{o1S#s4q>0C*J) A)c^nh literal 0 HcmV?d00001 diff --git a/testdata/corpus/561196e3c7fe954a5af83b57e70983630a7853c2-34 b/testdata/corpus/561196e3c7fe954a5af83b57e70983630a7853c2-34 new file mode 100644 index 0000000000000000000000000000000000000000..d248c166888e6eed2a05f94c1875c414022e0312 GIT binary patch literal 262 icmZQ&5MVH1~jg8^+ uzWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1i=d}fe7pn4Du(ua-T@EHIK!7!Ep literal 0 HcmV?d00001 diff --git a/testdata/corpus/5a0d7b4c4393b074f65d438e00e3ee9c2d2dcd3a-27 b/testdata/corpus/5a0d7b4c4393b074f65d438e00e3ee9c2d2dcd3a-27 new file mode 100644 index 0000000000000000000000000000000000000000..fd8fb51defa86708b0e03c67d3b9ae4eefb1e19a GIT binary patch literal 54 hcmd;J;ACK7U}j(gV&+%wVEPNgsl6cn3k-3XJOIVD2uuI~ literal 0 HcmV?d00001 diff --git a/testdata/corpus/5e23e4bf112063d0c37a109e08fd1b601f15c628-28 b/testdata/corpus/5e23e4bf112063d0c37a109e08fd1b601f15c628-28 new file mode 100644 index 0000000000000000000000000000000000000000..e3be547ddd162e2f463f54a3a5726c363c951d26 GIT binary patch literal 46 icmd;J;ACK7U}j(g;_0v4!Sok~Q+q-D7Yr~yj0OOrJqPCi literal 0 HcmV?d00001 diff --git a/testdata/corpus/61318d5938e840d21474d7bea49d7bedfde29b83-31 b/testdata/corpus/61318d5938e840d21474d7bea49d7bedfde29b83-31 new file mode 100644 index 0000000000000000000000000000000000000000..6232301dc0a7054978b3093d6d53cab1f87ea5d3 GIT binary patch literal 80 ocmcCbeZPNi1Q0`zAO`~*!`^)j4Iuh6g8mHUL+Sl!{06u<0O0Z?ssI20 literal 0 HcmV?d00001 diff --git a/testdata/corpus/622dccbf890ae7f21063096d5eea83a028a537dd-38 b/testdata/corpus/622dccbf890ae7f21063096d5eea83a028a537dd-38 new file mode 100644 index 0000000000000000000000000000000000000000..107e7a798ebd092b75358d229a33d6a93dd8738c GIT binary patch literal 116 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=Dm(SAC-r2>~jg8^+ bzWtv$7=8ii1|SXM24;qaeGLr&36}z` literal 0 HcmV?d00001 diff --git a/testdata/corpus/66f1c7684cd7c75946874fdbdc2465f89d18a5dc-20 b/testdata/corpus/66f1c7684cd7c75946874fdbdc2465f89d18a5dc-20 new file mode 100644 index 0000000000000000000000000000000000000000..ff8b76862f2775ab0016891ef545868f6c5e8dbb GIT binary patch literal 32 jcmd;JU}In~{OQQSz{$YEV8F-$;=f{k0iyTop4tllMM(xE literal 0 HcmV?d00001 diff --git a/testdata/corpus/692b57a81d0abfe9e4b8776eeecf40d7911b47ad-43 b/testdata/corpus/692b57a81d0abfe9e4b8776eeecf40d7911b47ad-43 new file mode 100644 index 0000000000000000000000000000000000000000..5059fad046b7c77a9ece66ccb9f47ab60268ee81 GIT binary patch literal 132 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=5m(SAC-r2>~jg8^+ qzWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1i=>Y1VXKr~1nga!aG5Ghgs literal 0 HcmV?d00001 diff --git a/testdata/corpus/69479959f9f5d29f6c968ac082feee48d466615c-22 b/testdata/corpus/69479959f9f5d29f6c968ac082feee48d466615c-22 new file mode 100644 index 0000000000000000000000000000000000000000..ee215d6f33932ae75eb720a07ae2f688a3afc74b GIT binary patch literal 56 xcmaFPpqTR0@uy>XHY3CSS3ey&7}ywqpaDdmez*io1Gx~|o~;oizIfl6y#Vr?5A6T| literal 0 HcmV?d00001 diff --git a/testdata/corpus/6a84edd9832c0bc796b635427cce3ccc484e3e2d-28 b/testdata/corpus/6a84edd9832c0bc796b635427cce3ccc484e3e2d-28 new file mode 100644 index 0000000000000000000000000000000000000000..5ecad373c4b8ce385ce09f96791f5c4b1f9e035d GIT binary patch literal 48 bcmd;JU}M<3uc3hhNPkAqpP_s-djDqtht(2L literal 0 HcmV?d00001 diff --git a/testdata/corpus/6afda136beeb06d713e259a759ed922943e47a98-21 b/testdata/corpus/6afda136beeb06d713e259a759ed922943e47a98-21 new file mode 100644 index 0000000000000000000000000000000000000000..baa22cb29cf85a53f809d34c3248a69bee2da111 GIT binary patch literal 38 ZcmZQ$U}j(eVm2hq@(arU520Cp0RSNp14RG; literal 0 HcmV?d00001 diff --git a/testdata/corpus/6f89d5aded6c91371c7ae1e9eaec66bce15f9619-28 b/testdata/corpus/6f89d5aded6c91371c7ae1e9eaec66bce15f9619-28 new file mode 100644 index 0000000000000000000000000000000000000000..c268600e090e56edeac2e12f47ddadf5c6b45dc7 GIT binary patch literal 14 UcmZQ$U}j+X#mvA4q)#*e01MCpTmS$7 literal 0 HcmV?d00001 diff --git a/testdata/corpus/7054923406767f563122be017a7152a8bae0cb36-21 b/testdata/corpus/7054923406767f563122be017a7152a8bae0cb36-21 new file mode 100644 index 0000000000000000000000000000000000000000..7d9c6870bdad94159963625d5659da96da747c8b GIT binary patch literal 56 zcmaF+|E?n=gA*eM0|x^TIEpZ^F*GnRyx+e!gysGI~jg8^+ ZzWtv$7=8ii1|SXMOf)u8Ot0U literal 0 HcmV?d00001 diff --git a/testdata/corpus/743e85424fb7f6667186c9f1b9f70c10ba747d6d-21 b/testdata/corpus/743e85424fb7f6667186c9f1b9f70c10ba747d6d-21 new file mode 100644 index 0000000000000000000000000000000000000000..d1aa32fa28f18ca7c14e936f3d2bf88f301244ab GIT binary patch literal 32 icmaFPpeV)g>Zcfe=h)x=m?tt literal 0 HcmV?d00001 diff --git a/testdata/corpus/74ac4d9601af6baf58547777fb497b42ede30f88-27 b/testdata/corpus/74ac4d9601af6baf58547777fb497b42ede30f88-27 new file mode 100644 index 0000000000000000000000000000000000000000..de47e396ed33ec6388d107fda7371bc98f52a861 GIT binary patch literal 38 pcmd;JU}In~RCDBD;ACK7*sz}i$ltGfYA=Xp1k!8_%nYaY0swNf2mb&7 literal 0 HcmV?d00001 diff --git a/testdata/corpus/78e417c9fbc9e87a6574803dee65eb0e2bd0f8e8-29 b/testdata/corpus/78e417c9fbc9e87a6574803dee65eb0e2bd0f8e8-29 new file mode 100644 index 0000000000000000000000000000000000000000..d2a2b3aaecb0a8c547b26e144cda30867fc7a418 GIT binary patch literal 22 VcmZQ$U}kvHz|6n~q_4y1RRAf}1Y!UH literal 0 HcmV?d00001 diff --git a/testdata/corpus/795a7e045ba15261a8b49ed1cce8ee29dc082350-22 b/testdata/corpus/795a7e045ba15261a8b49ed1cce8ee29dc082350-22 new file mode 100644 index 0000000000000000000000000000000000000000..b39e7d9b1a7dea26f6e781dbf6dc7daaf75327a4 GIT binary patch literal 48 dcmd;JU}M<->ZcN$CO;V}?+#TDqXGUg4qyNP literal 0 HcmV?d00001 diff --git a/testdata/corpus/85056e6758eb8ef28caa7581d86343753e9f45c6-20 b/testdata/corpus/85056e6758eb8ef28caa7581d86343753e9f45c6-20 new file mode 100644 index 0000000000000000000000000000000000000000..94add822352edc7e02bb8bc3a7340f57df503014 GIT binary patch literal 36 lcmaF+|E}X(1_MS81`Y-wa1>!+V<=`|_yXeOXI_2Zc<{9 literal 0 HcmV?d00001 diff --git a/testdata/corpus/91261faaf54bf23f25d249189bf9a582dfaa64fe-22 b/testdata/corpus/91261faaf54bf23f25d249189bf9a582dfaa64fe-22 new file mode 100644 index 0000000000000000000000000000000000000000..78b941a0649bbb7a1a3160d236e0a3767aef6a43 GIT binary patch literal 28 ecmd;J;9vj&5e8<41_p-r`}cbspHb=kVE*2H4GmCn7>!jO7X3u42LScAJw*Tj literal 0 HcmV?d00001 diff --git a/testdata/corpus/95525a678cc77a909ac2c370db1083dba484ce4f-35 b/testdata/corpus/95525a678cc77a909ac2c370db1083dba484ce4f-35 new file mode 100644 index 0000000000000000000000000000000000000000..52f21e24038dce724a3f52dc8e89ae81ace6370d GIT binary patch literal 88 ncmZQ$U}pHj;LhL%q(AR#Xy9OA1JR#R>HTPYWO)rF^$2wUKhPne literal 0 HcmV?d00001 diff --git a/testdata/corpus/958ac5d0464b542490eb0e7b5ce3fcc805b811c5-39 b/testdata/corpus/958ac5d0464b542490eb0e7b5ce3fcc805b811c5-39 new file mode 100644 index 0000000000000000000000000000000000000000..1db1760c69a0ed11df2f70f85ce73a2106e77ac7 GIT binary patch literal 124 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=Dm(SAC-r2>~jg8^+ izWtv$7=8ii1|SXOvj8=MFpQ5ugVZxKG=RmK!TJCzyeB;X literal 0 HcmV?d00001 diff --git a/testdata/corpus/9662b14e9c7f52333d6008f4e783c4c0cf4d0f77-42 b/testdata/corpus/9662b14e9c7f52333d6008f4e783c4c0cf4d0f77-42 new file mode 100644 index 0000000000000000000000000000000000000000..5bba42326d8a80da1d83ada680353aad48278f7e GIT binary patch literal 140 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=5m(SAC-r2>~jg8^+ szWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1jh?FXu3hN=hA==_Gy0GkjkX8-^I literal 0 HcmV?d00001 diff --git a/testdata/corpus/96ca40af244ed4652f3a9143c6477f8a77e0531d-23 b/testdata/corpus/96ca40af244ed4652f3a9143c6477f8a77e0531d-23 new file mode 100644 index 0000000000000000000000000000000000000000..b0382a1dafeb38e8e7d69103e20dbec72c8012fd GIT binary patch literal 24 ccmd;JU}M<-ii3dzNHZ`rG=S*O`}Q9I05viO3;+NC literal 0 HcmV?d00001 diff --git a/testdata/corpus/970545ce4d6cc514719f235496ac21fa7f21a804-25 b/testdata/corpus/970545ce4d6cc514719f235496ac21fa7f21a804-25 new file mode 100644 index 0000000000000000000000000000000000000000..bde032d65d0bd60a9764eedc25ba67429bf1e657 GIT binary patch literal 46 tcmd;JU}In~{OQQSz{$YEV8F-$>7nc)QxgXjhZcQE~j0RWuO2MPcH literal 0 HcmV?d00001 diff --git a/testdata/corpus/98ca06862f5ba07446b65acce33fdb1e0ea2eb48-42 b/testdata/corpus/98ca06862f5ba07446b65acce33fdb1e0ea2eb48-42 new file mode 100644 index 0000000000000000000000000000000000000000..a4688a9c743e31ba23b0bb77275447d29adedc37 GIT binary patch literal 132 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=Dm(SAC-r2>~jg8^+ kzWtv$7=8ii1|SXMD*M^)WLvfYn2202VhasQ>@~ literal 0 HcmV?d00001 diff --git a/testdata/corpus/9ccec1effec1c29c8a6302750a3b454cf102fbff-21 b/testdata/corpus/9ccec1effec1c29c8a6302750a3b454cf102fbff-21 new file mode 100644 index 0000000000000000000000000000000000000000..2316eae7e0c07281d80da046e12f79193a5a51b8 GIT binary patch literal 40 dcmd;JU}M<->ZcY literal 0 HcmV?d00001 diff --git a/testdata/corpus/a093e389660c78c3a71936a2ff33c5e2fa76e418-27 b/testdata/corpus/a093e389660c78c3a71936a2ff33c5e2fa76e418-27 new file mode 100644 index 0000000000000000000000000000000000000000..31b3db44375e19c26b629799eeba0404752571ba GIT binary patch literal 40 bcmd;JU}M<3uc3hhNPkAqpP_sxz5g=+2!IbB literal 0 HcmV?d00001 diff --git a/testdata/corpus/a4e3849ea4027af4efd9bb663e6feb781d453564-27 b/testdata/corpus/a4e3849ea4027af4efd9bb663e6feb781d453564-27 new file mode 100644 index 0000000000000000000000000000000000000000..c533438ee839e35af8ef2c9920ea3bf507ef2235 GIT binary patch literal 94 hcmZQ$U}j(eVm2`T45nFrLHI8kAT+6b=2uXCivb^-4730M literal 0 HcmV?d00001 diff --git a/testdata/corpus/a67fae5bc9da5fa322e96d74c3777fee64e9aa71-24 b/testdata/corpus/a67fae5bc9da5fa322e96d74c3777fee64e9aa71-24 new file mode 100644 index 0000000000000000000000000000000000000000..72ea1be5454a7440de550898080c1741cde60513 GIT binary patch literal 48 jcmZQz;9vj&5e8<41_p-r`}cXn(^)_1`#0Lz`*c+|K1Rm_xq2(X8;0ZF^2s>(U%Mi E042*4_5c6? literal 0 HcmV?d00001 diff --git a/testdata/corpus/b2c29cc7b65b833b1635b59ee2fcd03456750945-22 b/testdata/corpus/b2c29cc7b65b833b1635b59ee2fcd03456750945-22 new file mode 100644 index 0000000000000000000000000000000000000000..b047493479d583cdc3157521e739b55d89abfafc GIT binary patch literal 56 xcmaF+|E?n=gA*eM0|x^TIEpZ^F*GnRyx+e!gysGI~jg8^+ czWtv$7=8ii1|SXM!+V`yMtc)uUWY1qFPB*p*$!$=6w literal 0 HcmV?d00001 diff --git a/testdata/corpus/b9229ce6b5518054c6d1f07170f02c10b246456f-30 b/testdata/corpus/b9229ce6b5518054c6d1f07170f02c10b246456f-30 new file mode 100644 index 0000000000000000000000000000000000000000..1c9f2ab7d2832ad9077e0440dc89fe6f78e3e7fe GIT binary patch literal 174 xcmZQ$U}k7z_{_itq*;D3gXtFy5E`A2t`1!uosX^_m$~Tr(D}>_{~_*M3;<%Z8@vDj literal 0 HcmV?d00001 diff --git a/testdata/corpus/bc250e6c88ea13850c46f40da69bf60cdac1fcee-34 b/testdata/corpus/bc250e6c88ea13850c46f40da69bf60cdac1fcee-34 new file mode 100644 index 0000000000000000000000000000000000000000..2e96b2d303139508a3da8956fcd69a77b8e6b648 GIT binary patch literal 152 zcmcCbeZPNi1Q3JK8bJ;QHipmp8a|`a`@#Gp`x+Xc;xHOb9ZVlYJr;9t=)+VG0N>O= AZ2$lO literal 0 HcmV?d00001 diff --git a/testdata/corpus/bda17ae328d282daeeb2560f85d818e7d15bc7fa-21 b/testdata/corpus/bda17ae328d282daeeb2560f85d818e7d15bc7fa-21 new file mode 100644 index 0000000000000000000000000000000000000000..5f974bf1ea632118727e86da73ba8c4cab671cc1 GIT binary patch literal 48 vcmaFPpeV(V^3$3~UTQ&;X)OKU@N)8SL2_LHzyu_U{D%Rj3Wl literal 0 HcmV?d00001 diff --git a/testdata/corpus/c09de1dd7890e4f2ec9aea376a60d7ea515dd863-36 b/testdata/corpus/c09de1dd7890e4f2ec9aea376a60d7ea515dd863-36 new file mode 100644 index 0000000000000000000000000000000000000000..129560851c70b1ef9ba99f7ed587a1d9b5e61ef0 GIT binary patch literal 40 kcmZQ$U}pHjaB8mtkbVKgY(UKX${kF9VSvz|Up6!V0HcNo`2YX_ literal 0 HcmV?d00001 diff --git a/testdata/corpus/c4717fa8767291362425aed782add48fe20ee660-19 b/testdata/corpus/c4717fa8767291362425aed782add48fe20ee660-19 new file mode 100644 index 0000000000000000000000000000000000000000..08a97ab033584310c606223d52a7c34c0c72a6f3 GIT binary patch literal 32 fcmaFPpeV)g>ZcZa5GD(w*%+9hu5(B68M1FcY+_7e2Zjp(UD*nm literal 0 HcmV?d00001 diff --git a/testdata/corpus/d80c40bf0204735918c77b5915c50627373cd065-33 b/testdata/corpus/d80c40bf0204735918c77b5915c50627373cd065-33 new file mode 100644 index 0000000000000000000000000000000000000000..b7cfd7c8a0078e678cba0e16b7476b6587418f9b GIT binary patch literal 85 YcmZQ&5MVH1`O-vY8B;$Rvm4gl4T3Ag|N literal 0 HcmV?d00001 diff --git a/testdata/corpus/e1f5e15288f6686d97416661d18c132603f6c6be-24 b/testdata/corpus/e1f5e15288f6686d97416661d18c132603f6c6be-24 new file mode 100644 index 0000000000000000000000000000000000000000..c3a3b0851119f3d5240860d107d98e4b545da5c5 GIT binary patch literal 62 kcmZQ$U}j(eVm2hq@(aR$0TqMsnO{M~Sr)s4)&F4t0El4*AOHXW literal 0 HcmV?d00001 diff --git a/testdata/corpus/e36a6aaef9a37903ee9511da23f34816fa0031ad-19 b/testdata/corpus/e36a6aaef9a37903ee9511da23f34816fa0031ad-19 new file mode 100644 index 0000000000000000000000000000000000000000..0d51c1348211279c392335316a7ec34b99bb0961 GIT binary patch literal 36 ncmaF+|E}X(1}8=i1`Y-wa1>!+V`yMtc)x#d2n&z^i7@~G(n|_d literal 0 HcmV?d00001 diff --git a/testdata/corpus/e60c50d6540de0952cdc4f5d242bf79d4efc9dad-20 b/testdata/corpus/e60c50d6540de0952cdc4f5d242bf79d4efc9dad-20 new file mode 100644 index 0000000000000000000000000000000000000000..f00598cdc722ada872ed35420eb0628568c2f3a2 GIT binary patch literal 32 dcmd;JU}M<->Zc~jg8^+ QzWtv$fU1FN2+)}708v9Gv;Y7A literal 0 HcmV?d00001 diff --git a/testdata/corpus/ec1e7d06459318aa00f16bed7d5be9d5741e6583-42 b/testdata/corpus/ec1e7d06459318aa00f16bed7d5be9d5741e6583-42 new file mode 100644 index 0000000000000000000000000000000000000000..5e30390f9a31f5e73bd184142e99d27c9bb9f872 GIT binary patch literal 132 zcmZQ$U}ks$#3?|`{K}ny4M=}sfY6`!H8gNA7#JEEo0yuJTfE=5m(SAC-r2>~jg8^+ szWqSCUqHIyGY3%DXBMDF5Z=f90?dbqi^1i=>X||Mfa*asNFRg-05`KK#Q*>R literal 0 HcmV?d00001 diff --git a/testdata/corpus/f274272ee8782ab1d6fc81176f8f256b609bd503-28 b/testdata/corpus/f274272ee8782ab1d6fc81176f8f256b609bd503-28 new file mode 100644 index 0000000000000000000000000000000000000000..e95e2fd433ebdb44fbfb35016835c089c4bb610e GIT binary patch literal 384 zcmZQzU`Xa*U}9jep3lg^AjH4|#Sk`33>W literal 0 HcmV?d00001 diff --git a/testdata/corpus/f90dd0883bbf6eb74f1cbfeb8d45858aabac6efb-26 b/testdata/corpus/f90dd0883bbf6eb74f1cbfeb8d45858aabac6efb-26 new file mode 100644 index 0000000000000000000000000000000000000000..f38cab650dca415db22d52dd8ed8f04180d2edbc GIT binary patch literal 62 hcmZQ$U}j(eVm2`T45nFrLHI8kAT&Ck`4v=rF#yf^2e<$L literal 0 HcmV?d00001