aboutsummaryrefslogtreecommitdiff
path: root/contrib/tcpdump/print-ospf.c
diff options
context:
space:
mode:
authorBill Fenner <fenner@FreeBSD.org>1998-09-15 19:36:32 +0000
committerBill Fenner <fenner@FreeBSD.org>1998-09-15 19:36:32 +0000
commit4644f044b29b71b385396356b7cbf92b09e67628 (patch)
tree6bd786e664682d3877b9cca3efa525ac67d8e005 /contrib/tcpdump/print-ospf.c
parent4de76e31371f636d15e4005d6bed5755adb4c393 (diff)
downloadsrc-4644f044b29b71b385396356b7cbf92b09e67628.tar.gz
src-4644f044b29b71b385396356b7cbf92b09e67628.zip
Virgin import of LBL tcpdump v3.4
Notes
Notes: svn path=/vendor/tcpdump/dist/; revision=39297
Diffstat (limited to 'contrib/tcpdump/print-ospf.c')
-rw-r--r--contrib/tcpdump/print-ospf.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/contrib/tcpdump/print-ospf.c b/contrib/tcpdump/print-ospf.c
index 44e8737048a7..3de4ce53401f 100644
--- a/contrib/tcpdump/print-ospf.c
+++ b/contrib/tcpdump/print-ospf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1992, 1993, 1994, 1995, 1996
+ * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: print-ospf.c,v 1.23 96/12/10 23:15:46 leres Exp $ (LBL)";
+ "@(#) $Header: print-ospf.c,v 1.24 97/04/26 13:31:46 leres Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -215,11 +215,7 @@ ospf_print_lsa(register const struct lsa *lsap)
TCHECK(lsap->lsa_un.un_rla.rla_link);
rlp = lsap->lsa_un.un_rla.rla_link;
while (j--) {
- register struct rlalink *rln =
- (struct rlalink *)((u_char *)(rlp + 1) +
- ((rlp->link_toscount) * sizeof(*tosp)));
-
- TCHECK(*rln);
+ TCHECK(*rlp);
printf(" {"); /* } (ctags) */
switch (rlp->link_type) {
@@ -262,7 +258,8 @@ ospf_print_lsa(register const struct lsa *lsap)
}
/* { (ctags) */
printf(" }");
- rlp = rln;
+ rlp = (struct rlalink *)((u_char *)(rlp + 1) +
+ ((rlp->link_toscount) * sizeof(*tosp)));
}
break;
@@ -514,6 +511,13 @@ ospf_print(register const u_char *bp, register u_int length,
ipaddr_string(&ip->ip_src),
ipaddr_string(&ip->ip_dst));
+ /* XXX Before we do anything else, strip off the MD5 trailer */
+ TCHECK(op->ospf_authtype);
+ if (ntohs(op->ospf_authtype) == OSPF_AUTH_MD5) {
+ length -= OSPF_AUTH_MD5_LEN;
+ snapend -= OSPF_AUTH_MD5_LEN;
+ }
+
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
TCHECK(op->ospf_type);
@@ -555,6 +559,10 @@ ospf_print(register const u_char *bp, register u_int length,
printf("\"");
break;
+ case OSPF_AUTH_MD5:
+ printf(" auth MD5");
+ break;
+
default:
printf(" ??authtype-%d??", ntohs(op->ospf_authtype));
return;