X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsolaris%2Fdevice.c;h=4a57885c99250defedf60e385b0bb339a350bfa9;hb=0912260755021b9b836830dd99ae128c5fd912d9;hp=4bd88d73474ab1f75738174a48bd81f46c17b8c5;hpb=1f00810da336f3b7132df17b7fe4625748ff4b63;p=tinc diff --git a/src/solaris/device.c b/src/solaris/device.c index 4bd88d73..4a57885c 100644 --- a/src/solaris/device.c +++ b/src/solaris/device.c @@ -1,7 +1,7 @@ /* device.c -- Interaction with Solaris tun device - Copyright (C) 2001-2004 Ivo Timmermans , - 2001-2004 Guus Sliepen + Copyright (C) 2001-2005 Ivo Timmermans , + 2001-2005 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -127,8 +127,21 @@ bool read_packet(vpn_packet_t *packet) return false; } - packet->data[12] = 0x08; - packet->data[13] = 0x00; + switch(packet->data[14] >> 4) { + case 4: + packet->data[12] = 0x08; + packet->data[13] = 0x00; + break; + case 6: + packet->data[12] = 0x86; + packet->data[13] = 0xDD; + break; + default: + ifdebug(TRAFFIC) logger(LOG_ERR, + _ ("Unknown IP version %d while reading packet from %s %s"), + packet->data[14] >> 4, device_info, device); + return false; + } packet->len = lenin + 14;