diff options
author | dg <dg@FreeBSD.org> | 1994-02-10 09:17:57 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-02-10 09:17:57 +0000 |
commit | 1ba8f899932ac2374532b379c025ce8728d0acfb (patch) | |
tree | 2f4084aa2e71c37a5a0de6ffa53b1dee8713f552 /usr.sbin | |
parent | 9c5d30c5502f83ddf925e82f38ce4177961fb760 (diff) | |
download | FreeBSD-src-1ba8f899932ac2374532b379c025ce8728d0acfb.zip FreeBSD-src-1ba8f899932ac2374532b379c025ce8728d0acfb.tar.gz |
Fixed bug in decoding of RIP packets. RIP data is in "osockaddr" format;
the fix is to import the structures from protocols/routed.h and change
the sockaddr to osockaddr. We can't change the generic include file
because too many other things rely on this in order to deal with the
kernel routing socket (which is sockaddr format).
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tcpdump/tcpdump/print-rip.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/tcpdump/print-rip.c b/usr.sbin/tcpdump/tcpdump/print-rip.c index d123fe9..a824ce6 100644 --- a/usr.sbin/tcpdump/tcpdump/print-rip.c +++ b/usr.sbin/tcpdump/tcpdump/print-rip.c @@ -21,7 +21,7 @@ #ifndef lint static char rcsid[] = - "@(#) $Header: print-rip.c,v 1.12 91/04/19 10:46:46 mccanne Exp $ (LBL)"; + "@(#) $Header: /a/cvs/386BSD/src/contrib/tcpdump/tcpdump/print-rip.c,v 1.1.1.1 1993/06/12 14:42:07 rgrimes Exp $ (LBL)"; #endif #include <sys/param.h> @@ -33,13 +33,39 @@ static char rcsid[] = #include <netinet/ip_var.h> #include <netinet/udp.h> #include <netinet/udp_var.h> -#include <protocols/routed.h> #include <errno.h> #include "interface.h" #include "addrtoname.h" +#define RIPVERSION 1 + +struct netinfo { + struct osockaddr rip_dst; /* destination net/host */ + int rip_metric; /* cost of route */ +}; + +struct rip { + u_char rip_cmd; /* request/response */ + u_char rip_vers; /* protocol version # */ + u_char rip_res1[2]; /* pad to 32-bit boundary */ + union { + struct netinfo ru_nets[1]; /* variable length... */ + char ru_tracefile[1]; /* ditto ... */ + } ripun; +#define rip_nets ripun.ru_nets +#define rip_tracefile ripun.ru_tracefile +}; + +/* + * Packet types. + */ +#define RIPCMD_REQUEST 1 /* want info */ +#define RIPCMD_RESPONSE 2 /* responding to request */ +#define RIPCMD_TRACEON 3 /* turn tracing on */ +#define RIPCMD_TRACEOFF 4 /* turn it off */ + static void rip_entry_print(ni) register struct netinfo *ni; |