Project

General

Profile

Actions

Bug #917

closed

1.4.5: decode-ipv6.c: void function cannot return value

Added by Mark Solaris over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

This output:

"decode-ipv6.c", line 562: void function cannot return value
"decode-ipv6.c", line 565: void function cannot return value
"decode-ipv6.c", line 569: void function cannot return value
"decode-ipv6.c", line 572: void function cannot return value
"decode-ipv6.c", line 575: void function cannot return value
"decode-ipv6.c", line 577: void function cannot return value
cc: acomp failed for decode-ipv6.c

happens because of:

   558      switch(IPV6_GET_NH(p)) {
   559          case IPPROTO_TCP:
   560              IPV6_SET_L4PROTO (p, IPPROTO_TCP);
   561              return DecodeTCP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   562          case IPPROTO_UDP:
   563              IPV6_SET_L4PROTO (p, IPPROTO_UDP);
   564              return DecodeUDP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   565              break;
   566          case IPPROTO_ICMPV6:
   567              IPV6_SET_L4PROTO (p, IPPROTO_ICMPV6);
   568              return DecodeICMPV6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   569          case IPPROTO_SCTP:
   570              IPV6_SET_L4PROTO (p, IPPROTO_SCTP);
   571              return DecodeSCTP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   572          case IPPROTO_IPIP:
   573              IPV6_SET_L4PROTO(p, IPPROTO_IPIP);
   574              return DecodeIPv4inIPv6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   575          case IPPROTO_IPV6:
   576              return DecodeIP6inIP6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   577          case IPPROTO_FRAGMENT:

I suggest changing it to having the return on a separate line. I removed the unrequired 'break' in line 565 above.

   557      /* now process the Ext headers and/or the L4 Layer */
   558      switch(IPV6_GET_NH(p)) {
   559          case IPPROTO_TCP:
   560              IPV6_SET_L4PROTO (p, IPPROTO_TCP);
   561              DecodeTCP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   562              return;
   563          case IPPROTO_UDP:
   564              IPV6_SET_L4PROTO (p, IPPROTO_UDP);
   565              DecodeUDP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   566              return;
   567          case IPPROTO_ICMPV6:
   568              IPV6_SET_L4PROTO (p, IPPROTO_ICMPV6);
   569              DecodeICMPV6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   570              return;
   571          case IPPROTO_SCTP:
   572              IPV6_SET_L4PROTO (p, IPPROTO_SCTP);
   573              DecodeSCTP(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   574              return;
   575          case IPPROTO_IPIP:
   576              IPV6_SET_L4PROTO(p, IPPROTO_IPIP);
   577              DecodeIPv4inIPv6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   578              return;
   579          case IPPROTO_IPV6:
   580              DecodeIP6inIP6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p), pq);
   581              return;
   582          case IPPROTO_FRAGMENT:
   583          case IPPROTO_HOPOPTS:
Actions

Also available in: Atom PDF