diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-06-14 19:04:11 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-06-14 21:02:46 +0400 |
commit | c2b7b3b8fc79976d2f7e63f4a82dd827b9821fef (patch) | |
tree | 411ea8fdbf235f47e8fa1380b313fedfe7aacbe7 /usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c | |
parent | 88101adac56be10a45a8bb6e30ea372a7ab82a44 (diff) | |
download | snoop-c2b7b3b8fc79976d2f7e63f4a82dd827b9821fef.tar.gz |
Fixed warnings and build failures on amd64
Diffstat (limited to 'usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c')
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c index 5c6bde0..8112727 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c @@ -38,7 +38,6 @@ #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/if_ether.h> -#include <sys/ib/clients/ibd/ibd.h> #include <sys/ethernet.h> #include <sys/vlan.h> #include <sys/zone.h> @@ -52,6 +51,20 @@ #include "at.h" #include "snoop.h" +#ifndef IPOIB_HDRSIZE +/* + * IETF defined IPoIB encapsulation header, with 2b of ethertype + * followed by 2 reserved bytes. This is at the start of the + * datagram sent to and received over the wire by the driver. +*/ +typedef struct ipoib_header { + unsigned short ipoib_type; + unsigned short ipoib_mbz; +} ipoib_hdr_t; +#define IPOIB_HDRSIZE (sizeof(struct ipoib_header)) +#endif + + static headerlen_fn_t ether_header_len, fddi_header_len, tr_header_len, ib_header_len, ipnet_header_len, ipv4_header_len, ipv6_header_len; static interpreter_fn_t interpret_ether, interpret_fddi, interpret_tr, @@ -98,7 +111,7 @@ interface_t INTERFACES[] = { { DL_6TO4, 0, 9, 1, IPPROTO_ENCAP, IPPROTO_IPV6, ipv4_header_len, interpret_iptun, B_FALSE }, - { (uint_t)-1, 0, 0, 0, 0, NULL, NULL, B_FALSE } + { (uint_t)-1, 0, 0, 0, 0, 0, 0, B_FALSE } }; /* externals */ @@ -1692,12 +1705,12 @@ interpret_ipnet(int flags, char *header, int elen, int origlen) if (dl.dli_zsrc == ALL_ZONES) sprintf(szone, "Unknown"); else - sprintf(szone, "%lu", BE_32(dl.dli_zsrc)); + sprintf(szone, "%u", BE_32(dl.dli_zsrc)); if (dl.dli_zdst == ALL_ZONES) sprintf(dzone, "Unknown"); else - sprintf(dzone, "%lu", BE_32(dl.dli_zdst)); + sprintf(dzone, "%u", BE_32(dl.dli_zdst)); if (flags & F_SUM) { (void) snprintf(get_sum_line(), MAXLINE, |