aboutsummaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-01-15 18:36:34 +0100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2016-01-18 11:58:03 +1100
commitc74ddc995439881edf1ec582591e5e50ff8e7ca5 (patch)
tree62f256051b5024ef72c9cffa444dbc0a1bc3a375 /clients
parentfe7b047c0c0e3ca4c77eda5ee5fe627e2718981d (diff)
downloadSLOF-c74ddc995439881edf1ec582591e5e50ff8e7ca5.zip
SLOF-c74ddc995439881edf1ec582591e5e50ff8e7ca5.tar.gz
SLOF-c74ddc995439881edf1ec582591e5e50ff8e7ca5.tar.bz2
net-snk: Remove bad NEIGHBOUR_SOLICITATION code in send_ipv6()
The code that checks for NEIGHBOUR_SOLICITATION packets is bad in two ways: First, it does not check that the packet is really an ICMPv6 packet, so it could accidentially be triggered for UDP or TCP packets, too. Second, the fill_ethhdr() is redundant (since it is done at the end of the function again) and also wrong (it uses the wrong buffer pointer to fill in the ethernet header). All we really need here is to get the right MAC address via ip6_to_multicast_mac() - and this is handled in the following if-statement already (NEIGHBOUR_SOLICITATIONs are always sent as multicast in the send_neighbour_solicitation() function), so the bad code block can simply be removed to fix the two issues. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'clients')
-rw-r--r--clients/net-snk/app/netlib/ipv6.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/clients/net-snk/app/netlib/ipv6.c b/clients/net-snk/app/netlib/ipv6.c
index 2d2d952..5b38ee0 100644
--- a/clients/net-snk/app/netlib/ipv6.c
+++ b/clients/net-snk/app/netlib/ipv6.c
@@ -530,16 +530,8 @@ send_ipv6 (int fd, void* buffer, int len)
n = find_neighbor (&ip_dst);
- // If packet is a neighbor solicitation
- if (icmp6h->type == ICMPV6_NEIGHBOUR_SOLICITATION) {
- mac_addr = ip6_to_multicast_mac (&ip_dst);
- fill_ethhdr( buffer-sizeof(struct ethhdr), htons(ETHERTYPE_IPv6),
- get_mac_address(),
- mac_addr);
- }
-
// If address is a multicast address, create a proper mac address
- else if (ip6_is_multicast (&ip_dst)) {
+ if (ip6_is_multicast (&ip_dst)) {
mac_addr = ip6_to_multicast_mac (&ip_dst);
}
else {