summaryrefslogtreecommitdiff
path: root/staging/tools.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-22mausezahn: improve random mac address generationMatteo Croce1-7/+1
Modify -b option to generate all random MAC addresses. Improve the random generation algorithm, use nrand48() which fills the ethernet address in two calls instead of six calls to rand() and six floating point calculations. Set the locally administered bit of generated MAC addresses. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-15mausezahn: Fix IPv6 address comparisonPetr Machata1-2/+2
CMP_INT evaluates its arguments more than once, and thus passing a post-incremented pointer as an argument causes double increments and hence buffer overruns. This can be observed by erratic behavior of IPv6 address ranges. Fix by moving the increment to loop header. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2016-03-29mausezahn: Allow IPv6 ranges to be specified for source and dest addressesTommy Beadle1-0/+254
This allows a user to pass a range of IPv6 addresses, either like: fec0:5000::1-fec0:5000::100 or in CIDR notation: fec0:5000::0/112 These can be used for the -A and/or -B command-line options. The largest range that can be used is a /64. In other words, if using CIDR notation, the masklen must be <= 128 and >= 64. Signed-off-by: Tommy Beadle <tbeadle@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2015-04-21mausezahn: Make sure '\0' is written after strncpyTobias Klauser1-2/+3
Make sure params is always NULL-terminated as strncpy() doesn't guarantee this. Closes #134 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2013-05-13staging: add mausezahn staging directoryDaniel Borkmann1-0/+1344
After some back and forth, we decided that it is easier to maintain mausezahn in a staging directory until it is fully reworked and cleaned up to be ready to be fully integrated. This way, it is better than having it in a separate branch, and we can also accept patches from outside more easily. Also, while at it, fix up some function mismatches with libcli. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>