uninitialized
[platform/upstream/tcpdump.git] / packaging / tcpdump-4.0.0-aliasing.patch
1 Index: icmp6.h
2 ===================================================================
3 --- icmp6.h.orig
4 +++ icmp6.h
5 @@ -404,7 +404,11 @@ struct icmp6_router_renum {        /* router re
6         u_int8_t        rr_segnum;
7         u_int8_t        rr_flags;
8         u_int16_t       rr_maxdelay;
9 +       union {
10 +               u_int8_t        rr_reserved8[4];
11 +               u_int16_t       rr_reserved16[2];
12         u_int32_t       rr_reserved;
13 +       };
14  };
15  #define ICMP6_RR_FLAGS_TEST            0x80
16  #define ICMP6_RR_FLAGS_REQRESULT       0x40
17 Index: print-icmp.c
18 ===================================================================
19 --- print-icmp.c.orig
20 +++ print-icmp.c
21 @@ -47,6 +47,12 @@ static const char rcsid[] _U_ =
22   * Per RFC 792, September 1981.
23   */
24  
25 +/* rfc1191 */
26 +struct mtu_discovery {
27 +       u_int16_t unused;
28 +       u_int16_t nexthopmtu;
29 +};
30 +
31  /*
32   * Structure of an icmp header.
33   */
34 @@ -61,8 +67,12 @@ struct icmp {
35                         u_int16_t icd_id;
36                         u_int16_t icd_seq;
37                 } ih_idseq;
38 +               union {
39                 u_int32_t ih_void;
40 +                       struct mtu_discovery ih_mtu_discovery;
41 +               };
42         } icmp_hun;
43 +#define icmp_mtu_discovery icmp_hun.ih_mtu_discovery
44  #define        icmp_pptr       icmp_hun.ih_pptr
45  #define        icmp_gwaddr     icmp_hun.ih_gwaddr
46  #define        icmp_id         icmp_hun.ih_idseq.icd_id
47 @@ -243,12 +253,6 @@ static struct tok type2str[] = {
48         { 0,                            NULL }
49  };
50  
51 -/* rfc1191 */
52 -struct mtu_discovery {
53 -       u_int16_t unused;
54 -       u_int16_t nexthopmtu;
55 -};
56 -
57  /* rfc1256 */
58  struct ih_rdiscovery {
59         u_int8_t ird_addrnum;
60 @@ -413,7 +417,7 @@ icmp_print(const u_char *bp, u_int plen,
61                 case ICMP_UNREACH_NEEDFRAG:
62                     {
63                         register const struct mtu_discovery *mp;
64 -                       mp = (struct mtu_discovery *)(u_char *)&dp->icmp_void;
65 +                       mp = &dp->icmp_mtu_discovery;
66                         mtu = EXTRACT_16BITS(&mp->nexthopmtu);
67                         if (mtu) {
68                                 (void)snprintf(buf, sizeof(buf),
69 Index: print-icmp6.c
70 ===================================================================
71 --- print-icmp6.c.orig
72 +++ print-icmp6.c
73 @@ -1279,7 +1279,7 @@ icmp6_rrenum_print(const u_char *bp, con
74                 printf("seg=%u,", rr6->rr_segnum);
75                 printf("maxdelay=%u", EXTRACT_16BITS(&rr6->rr_maxdelay));
76                 if (rr6->rr_reserved)
77 -                       printf("rsvd=0x%x", EXTRACT_32BITS(&rr6->rr_reserved));
78 +                       printf("rsvd=0x%x", EXTRACT_16BITS(&rr6->rr_reserved16[0]));
79                 /*[*/
80                 printf("]");
81  #undef F
82 Index: print-timed.c
83 ===================================================================
84 --- print-timed.c.orig
85 +++ print-timed.c
86 @@ -86,8 +86,8 @@ timed_print(register const u_char *bp)
87                         fputs(" [|timed]", stdout);
88                         return;
89                 }
90 -               sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec);
91 -               usec = EXTRACT_32BITS(&tsp->tsp_time.tv_usec);
92 +               sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec32[0]);
93 +               usec = EXTRACT_32BITS(&tsp->tsp_time.tv_usec32[0]);
94                 if (usec < 0)
95                         /* corrupt, skip the rest of the packet */
96                         return;
97 Index: timed.h
98 ===================================================================
99 --- timed.h.orig
100 +++ timed.h
101 @@ -54,7 +54,16 @@ struct tsp {
102         u_int8_t        tsp_vers;
103         u_int16_t       tsp_seq;
104         union {
105 -               struct tsp_timeval tspu_time;
106 +               struct {
107 +                       union {
108 +                               int     tv_sec32[2];
109 +                               long    tv_sec;
110 +                       };
111 +                       union {
112 +                               int     tv_usec32[2];
113 +                               long    tv_usec;
114 +                               };
115 +               } tspu_time;
116                 int8_t tspu_hopcnt;
117         } tsp_u;
118         int8_t tsp_name[256];