Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / net / net-snmp / patches / patch-dr
blobcfdfed45aff60ebfa90c78874a10ede1e48c2e60
1 $NetBSD$
3 --- agent/mibgroup/mibII/tcpTable.c.orig        2010-10-20 13:12:08.000000000 +0000
4 +++ agent/mibgroup/mibII/tcpTable.c
5 @@ -838,7 +838,11 @@ tcpTable_load(netsnmp_cache *cache, void
6      size_t   len;
7      int      sname[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_PCBLIST };
8      char     *tcpcb_buf = NULL;
9 +#if defined(dragonfly)
10 +    struct xtcpcb *xig = NULL;
11 +#else
12      struct xinpgen *xig = NULL;
13 +#endif
14      netsnmp_inpcb  *nnew;
15      int      StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
17 @@ -860,10 +864,18 @@ tcpTable_load(netsnmp_cache *cache, void
18       *  Unpick this into the constituent 'xinpgen' structures, and extract
19       *     the 'inpcb' elements into a linked list (built in reverse)
20       */
21 +#if defined(dragonfly)
22 +    xig = (struct xtcpcb *) tcpcb_buf;
23 +#else
24      xig = (struct xinpgen *) tcpcb_buf;
25      xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
26 +#endif
28 +#if defined(dragonfly)
29 +    while (xig && ((char *)xig + xig->xt_len < tcpcb_buf + len)) {
30 +#else
31      while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
32 +#endif
33          nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
34          if (!nnew)
35              break;
36 @@ -876,7 +888,11 @@ tcpTable_load(netsnmp_cache *cache, void
38         nnew->inp_next = tcp_head;
39         tcp_head   = nnew;
40 +#if defined(dragonfly)
41 +        xig = (struct xtcpcb *) ((char *) xig + xig->xt_len);
42 +#else
43          xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
44 +#endif
45      }
47      free(tcpcb_buf);