projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4708f2c
)
Fixes for definitions under Windows.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 11 Apr 2010 17:20:02 +0000
(19:20 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 11 Apr 2010 17:20:02 +0000
(19:20 +0200)
lib/ipv6.h
patch
|
blob
|
history
src/route.c
patch
|
blob
|
history
diff --git
a/lib/ipv6.h
b/lib/ipv6.h
index
fee74f5
..
d98001d
100644
(file)
--- a/
lib/ipv6.h
+++ b/
lib/ipv6.h
@@
-95,6
+95,7
@@
struct icmp6_hdr {
#define ICMP6_DST_UNREACH_NOROUTE 0
#define ICMP6_DST_UNREACH 1
#define ICMP6_PACKET_TOO_BIG 2
#define ICMP6_DST_UNREACH_NOROUTE 0
#define ICMP6_DST_UNREACH 1
#define ICMP6_PACKET_TOO_BIG 2
+#define ICMP6_DST_UNREACH_ADMIN 1
#define ICMP6_DST_UNREACH_ADDR 3
#define ND_NEIGHBOR_SOLICIT 135
#define ND_NEIGHBOR_ADVERT 136
#define ICMP6_DST_UNREACH_ADDR 3
#define ND_NEIGHBOR_SOLICIT 135
#define ND_NEIGHBOR_ADVERT 136
diff --git
a/src/route.c
b/src/route.c
index
853b7f5
..
3d8d54a
100644
(file)
--- a/
src/route.c
+++ b/
src/route.c
@@
-50,7
+50,7
@@
static const size_t ip6_size = sizeof(struct ip6_hdr);
static const size_t icmp6_size = sizeof(struct icmp6_hdr);
static const size_t ns_size = sizeof(struct nd_neighbor_solicit);
static const size_t opt_size = sizeof(struct nd_opt_hdr);
static const size_t icmp6_size = sizeof(struct icmp6_hdr);
static const size_t ns_size = sizeof(struct nd_neighbor_solicit);
static const size_t opt_size = sizeof(struct nd_opt_hdr);
-#define
max
(a, b) ((a) > (b) ? (a) : (b))
+#define
MAX
(a, b) ((a) > (b) ? (a) : (b))
/* RFC 1071 */
/* RFC 1071 */
@@
-398,10
+398,10
@@
static void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) {
if(directonly && subnet->owner != via)
return route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_NET_ANO);
if(directonly && subnet->owner != via)
return route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_NET_ANO);
- if(via && packet->len >
max
(via->mtu, 590) && via != myself) {
+ if(via && packet->len >
MAX
(via->mtu, 590) && via != myself) {
ifdebug(TRAFFIC) logger(LOG_INFO, "Packet for %s (%s) length %d larger than MTU %d", subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu);
if(packet->data[20] & 0x40) {
ifdebug(TRAFFIC) logger(LOG_INFO, "Packet for %s (%s) length %d larger than MTU %d", subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu);
if(packet->data[20] & 0x40) {
- packet->len =
max
(via->mtu, 590);
+ packet->len =
MAX
(via->mtu, 590);
route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED);
} else {
fragment_ipv4_packet(via, packet);
route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED);
} else {
fragment_ipv4_packet(via, packet);
@@
-549,9
+549,9
@@
static void route_ipv6_unicast(node_t *source, vpn_packet_t *packet) {
if(directonly && subnet->owner != via)
return route_ipv6_unreachable(source, packet, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN);
if(directonly && subnet->owner != via)
return route_ipv6_unreachable(source, packet, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADMIN);
- if(via && packet->len >
max
(via->mtu, 1294) && via != myself) {
+ if(via && packet->len >
MAX
(via->mtu, 1294) && via != myself) {
ifdebug(TRAFFIC) logger(LOG_INFO, "Packet for %s (%s) length %d larger than MTU %d", subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu);
ifdebug(TRAFFIC) logger(LOG_INFO, "Packet for %s (%s) length %d larger than MTU %d", subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu);
- packet->len =
max
(via->mtu, 1294);
+ packet->len =
MAX
(via->mtu, 1294);
route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0);
return;
}
route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0);
return;
}