- 10 Nov, 2016 1 commit
-
-
Mike Frysinger authored
The only reason we include this header is to get the IP_DF define. However, we already have a local #define fallback in case that isn't already defined for us. Including this header while also including linux/if_tunnel.h causes problems with newer Linux headers (v4.8+): cc -O2 -g -Wall -fno-strict-aliasing -D_GNU_SOURCE \ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \ -I. -I/usr/local/src/net-tools/include -Ilib -c iptunnel.c In file included from /usr/include/linux/if_tunnel.h:6:0, from iptunnel.c:34: /usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr' struct iphdr { ^ In file included from iptunnel.c:29:0: /usr/include/netinet/ip.h:44:8: note: originally defined here struct iphdr ^ Changing netinet/ip.h to linux/ip.h won't help because it doesn't provide IP_DF or anything else we care about. Simply drop the header to avoid the build failure. Reported-by: Randy MacLeod <randy.macleod@windriver.com>
-
- 10 Jul, 2016 1 commit
-
-
Eugen Feller authored
Thanks to Eugen Feller.
-
- 15 Feb, 2016 5 commits
-
-
Mike Frysinger authored
-
Mike Frysinger authored
-
Mike Frysinger authored
-
Mike Frysinger authored
-
Mike Frysinger authored
Avoid using `ls` to get the file list as its behavior can be changed by env vars. Using shell globs instead should be much more stable. Also check the exit value of the install command itself and abort if we fail to install a man page.
-
- 13 Feb, 2016 2 commits
-
-
Mike Frysinger authored
The kernel will delete alias interfaces when you assign it an address of 0.0.0.0. i.e. These two commands will both destroy eth0:0: ifconfig eth0:0 0.0.0.0 ifconfig eth0:0 del Omit the implicit "up" behavior when this addr is given as the kernel will always throw an error. Distros/people have long gotten into the habit of deleting addresses by assigning 0.0.0.0. URL: https://bugs.gentoo.org/568446Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
-
Mike Frysinger authored
The ifconfig tool has long had the ability to suppress implicit bring up by adding an - suffix to the alias name. Document this in the man page. URL: https://bugs.gentoo.org/568446Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
-
- 27 Jan, 2016 1 commit
-
-
Mike Frysinger authored
We use scanf %64[...] to get local addresses, but then we store the result into a char[64] buffer. Since scanf always writes a terminating NUL, we overflow the buffer by a single byte. Use a buffer of 128 bytes to match the style of other funcs in this file. Reported-by: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
-
- 12 Jan, 2016 1 commit
-
-
Cédric BRINER authored
-
- 24 Nov, 2015 5 commits
-
-
Mike Frysinger authored
This changes the hostname behavior to match other systems and its own documentation. Namely, that -s just parses the result of the active gethostname() and does not attempt any network/DNS traffic. Other distros like Fedora/RedHat and Debian/Ubuntu have also changed their behavior in this regard. URL: https://bugzilla.redhat.com/319981 URL: https://bugzilla.redhat.com/531702 URL: https://bugs.debian.org/552482 URL: https://bugs.gentoo.org/515836
-
Mike Frysinger authored
After the typo fixes, some of the translations were duplicated leading to errors during message generation.
-
Felix Kaiser authored
-
Mike Frysinger authored
Not all sockaddr structs have the same alignment. Instead, it depends on the fields contained in it. The way net-tools has written things though, it accepts sockaddr* everywhere which has 16bit alignment, even though it will cast it to other sockaddr types that have higher alignment. For example, `route` can crash on alpha because it declares sockaddr on the stack, but then casts it up to sockaddr_in6 (which has 32bits). It's also bad storage wise as we might try to cast the sockaddr to a type that is larger than sockaddr which means clobbering the stack. Instead, lets rewrite all the APIs to take a sockaddr_storage. This is guaranteed to have both the maximum alignment and size requirements for all other sockaddr types. Now we can safely cast that pointer to any other sockaddr type and not worry about it. It also has the nice effect of deleting a lot of casts in a lot of places when we only need the type of family. The vast majority of changes here are mechanical. There are a few places where we have to memcpy between a dedicated sockaddr_storage and a smaller struct because we're using an external embedded type (like arpreq). URL: https://bugs.gentoo.org/558436
-
Mike Frysinger authored
Rather than use different sockaddr base types for storage, always start with sockaddr_storage on the stack and set up pointers to more limited versions to that. This way we always get the correct alignment and storage when we pass it down to lower layers. This is really just a set up for a follow up change to convert the codebase entirely to sockaddr_storage. This is just a fairly self contained change.
-
- 24 Oct, 2015 1 commit
-
-
Tomáš Odehnal authored
Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
-
- 29 Aug, 2015 10 commits
-
-
Mike Frysinger authored
This way we can support any length line w/out hardcoded buffer limits.
-
Mike Frysinger authored
Move the strlen calculation outside the loop to avoid recalculating it every time.
-
Phil Knirsch authored
In the output of netstat --ipx, the network and port numbers are byteswapped. For instance: Proto Recv-Q Send-Q Local Address Foreign Address State IPX 0 0 000A6F83:2E40 04036F83:000000000001:5104 ESTAB The local network number is actually 836F0A00, and the NetWare server reports my socket number as 402E. Similarly, the server's address is 836F0304:000000000001, and the standard NCP port is 0415. URL: https://bugzilla.redhat.com/show_bug.cgi?id=46434Reported-by: Ben Harris <bjh21@cam.ac.uk>
-
Jeff Johnson authored
The parsing logic doesn't handle IPv6 addresses. Clean it all up.
-
Jeff Johnson authored
-
Mike Frysinger authored
Rather than do the sorting at runtime, run the tables through `sort`. This lets us constify them and speed up runtime slightly.
-
Mike Frysinger authored
-
Mike Frysinger authored
Mark all the read-only strings in this file as const.
-
Mike Frysinger authored
The vast majority of these aren't used outside of this file, so mark them all static accordingly.
-
Mike Frysinger authored
-
- 26 Aug, 2015 6 commits
-
-
Mike Frysinger authored
Some of the globs might expand into files that start with a dash, so pass -- everywhere to keep problems from showing up. Some call sites don't actually need this, but better to be consistent.
-
Mike Frysinger authored
There's no need to cast the char* to a struct in6_addr*, so delete that logic. Switch the hardcoded 80 limit to the INET6_ADDRSTRLEN constant. Make sure the buffer we pass into inet_ntop is always NUL terminated.
-
Mike Frysinger authored
This is only used in this file, so localize it.
-
Mike Frysinger authored
This might end up violating alignment requirements, so memcpy the variable through a short variable instead. For most systems, this will optimize into the same code anyways, and for the rest, we need to do it this way to avoid unaligned accesses crashing. URL: https://bugs.gentoo.org/558436
-
Mike Frysinger authored
This avoids casting from a char* pointer to a struct in_addr* pointer which have different alignment requirements, and moves away from the deprecated inet_ntoa function. URL: https://bugs.gentoo.org/558436
-
Mike Frysinger authored
-
- 25 Aug, 2015 7 commits
-
-
Mike Frysinger authored
The former is the standard name now while the latter is the old one.
-
Mike Frysinger authored
The code assumes that sizeof(sin_addr.s_addr) == sizeof(long) == 4 which fails badly on 64bit systems -- we end up reading 4 extra bytes into the storage. Instead, load things indirectly via uint32_t variables since these are IPv4 addresses.
-
Mike Frysinger authored
-
Mike Frysinger authored
Use inet_ntop everywhere so that we only have one code path between IPv4 and IPv6. This also fixes some alignment warnings (due to gethostname returning char* pointers which we then cast up to in_addr structs). URL: https://bugs.gentoo.org/558436
-
Mike Frysinger authored
Most callers never modify this structure, so constify it everywhere.
-
Mike Frysinger authored
Most callers never modify this structure, so constify it everywhere.
-
Mike Frysinger authored
These strings are static data set in sub-modules and never modified.
-