Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong proto and byte order in dump_ipv6_packet #549

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix icmp checksum calculation in openvas-nasl. [#543](https://github.com/greenbone/openvas/pull/543)
- Fix ipv6 flow label in nasl_packet_forgery_v6() for openvas-nasl. [#545](https://github.com/greenbone/openvas/pull/545)
- Fix name of NASL internal IPPROTO_IP variable. [#552](https://github.com/greenbone/openvas/pull/552)
- Fix byte ordering and wrong PROTO identifier in dump_ipv6_packet() for openvas-nasl. [#549](https://github.com/greenbone/openvas/pull/549)

### Removed
- Removed "network scan" mode. This includes removal of NASL API methods "scan_phase()" and "network_targets()". Sending a "network_mode=yes" in a scanner configuration will have no effect anymore. [#493](https://github.com/greenbone/openvas/pull/493)
Expand Down
1 change: 1 addition & 0 deletions nasl/nasl_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ static struct
{"IPPROTO_TCP", IPPROTO_TCP},
{"IPPROTO_UDP", IPPROTO_UDP},
{"IPPROTO_ICMP", IPPROTO_ICMP},
{"IPPROTO_ICMPV6", IPPROTO_ICMPV6},
{"IPPROTO_IP", IPPROTO_IP},
{"IPPROTO_IGMP", IPPROTO_IGMP},
{"ENCAPS_AUTO", OPENVAS_ENCAPS_AUTO},
Expand Down
4 changes: 2 additions & 2 deletions nasl/nasl_packet_forgery.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,8 @@ dump_tcp_packet (lex_ctxt *lexic)
printf (" (%d)", tcp->th_flags);
printf ("\n");
printf ("\tth_win : %d\n", ntohs (tcp->th_win));
printf ("\tth_sum : 0x%x\n", tcp->th_sum);
printf ("\tth_urp : %d\n", tcp->th_urp);
printf ("\tth_sum : 0x%x\n", ntohs (tcp->th_sum));
printf ("\tth_urp : %d\n", ntohs (tcp->th_urp));
printf ("\tData : ");
c = (char *) ((char *) tcp + sizeof (struct tcphdr));
if (UNFIX (ip->ip_len) > (sizeof (struct ip) + sizeof (struct tcphdr)))
Expand Down
15 changes: 7 additions & 8 deletions nasl/nasl_packet_forgery_v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,22 +330,21 @@ dump_ipv6_packet (lex_ctxt *lexic)
else
{
printf ("------\n");
printf ("\tip6_v : %d\n", ip6->ip6_flow >> 28);
printf ("\tip6_tc: %d\n", (ip6->ip6_flow >> 20) & 0xff);
printf ("\tip6_fl: %d\n", (ip6->ip6_flow) & 0x3ffff);
printf ("\tip6_v : %d\n", ntohl (ip6->ip6_flow) >> 28);
printf ("\tip6_tc: %d\n", (ntohl (ip6->ip6_flow) >> 20) & 0xff);
printf ("\tip6_fl: %d\n", ntohl (ip6->ip6_flow) & 0x3ffff);
printf ("\tip6_plen: %d\n", UNFIX (ip6->ip6_plen));
printf ("\tip6_nxt : %d\n", ntohs (ip6->ip6_nxt));
printf ("\tip6_hlim : %d\n", ntohs (ip6->ip6_hlim));
switch (ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt)
printf ("\tip6_hlim : %d\n", ip6->ip6_hlim);
switch (ip6->ip6_nxt)
{
case IPPROTO_TCP:
printf ("\tip6_nxt : IPPROTO_TCP (%d)\n", ip6->ip6_nxt);
break;
case IPPROTO_UDP:
printf ("\tip6_nxt : IPPROTO_UDP (%d)\n", ip6->ip6_nxt);
break;
case IPPROTO_ICMP:
printf ("\tip6_nxt : IPPROTO_ICMP (%d)\n", ip6->ip6_nxt);
case IPPROTO_ICMPV6:
printf ("\tip6_nxt : IPPROTO_ICMPV6 (%d)\n", ip6->ip6_nxt);
break;
default:
printf ("\tip6_nxt : %d\n", ip6->ip6_nxt);
Expand Down