Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10173
b: refs/heads/master
c: 80b30c1
h: refs/heads/master
i:
  10171: b13e4d0
v: v3
  • Loading branch information
Herbert Xu authored and Arnaldo Carvalho de Melo committed Oct 26, 2005
1 parent d8b7bb3 commit e60ad10
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1371e37da299d4df6267ad0ddf010435782c28e9
refs/heads/master: 80b30c1023dbd795faf948dee0cfb3b270b56d47
1 change: 0 additions & 1 deletion trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ struct dst_ops
struct dst_entry * (*negative_advice)(struct dst_entry *);
void (*link_failure)(struct sk_buff *);
void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
int (*get_mss)(struct dst_entry *dst, u32 mtu);
int entry_size;

atomic_t entries;
Expand Down
43 changes: 0 additions & 43 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,46 +1192,6 @@ int xfrm_bundle_ok(struct xfrm_dst *first, struct flowi *fl, int family)

EXPORT_SYMBOL(xfrm_bundle_ok);

/* Well... that's _TASK_. We need to scan through transformation
* list and figure out what mss tcp should generate in order to
* final datagram fit to mtu. Mama mia... :-)
*
* Apparently, some easy way exists, but we used to choose the most
* bizarre ones. :-) So, raising Kalashnikov... tra-ta-ta.
*
* Consider this function as something like dark humour. :-)
*/
static int xfrm_get_mss(struct dst_entry *dst, u32 mtu)
{
int res = mtu - dst->header_len;

for (;;) {
struct dst_entry *d = dst;
int m = res;

do {
struct xfrm_state *x = d->xfrm;
if (x) {
spin_lock_bh(&x->lock);
if (x->km.state == XFRM_STATE_VALID &&
x->type && x->type->get_max_size)
m = x->type->get_max_size(d->xfrm, m);
else
m += x->props.header_len;
spin_unlock_bh(&x->lock);
}
} while ((d = d->child) != NULL);

if (m <= mtu)
break;
res -= (m - mtu);
if (res < 88)
return mtu;
}

return res + dst->header_len;
}

int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
{
int err = 0;
Expand All @@ -1252,8 +1212,6 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
dst_ops->negative_advice = xfrm_negative_advice;
if (likely(dst_ops->link_failure == NULL))
dst_ops->link_failure = xfrm_link_failure;
if (likely(dst_ops->get_mss == NULL))
dst_ops->get_mss = xfrm_get_mss;
if (likely(afinfo->garbage_collect == NULL))
afinfo->garbage_collect = __xfrm_garbage_collect;
xfrm_policy_afinfo[afinfo->family] = afinfo;
Expand Down Expand Up @@ -1281,7 +1239,6 @@ int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo)
dst_ops->check = NULL;
dst_ops->negative_advice = NULL;
dst_ops->link_failure = NULL;
dst_ops->get_mss = NULL;
afinfo->garbage_collect = NULL;
}
}
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,12 @@ void xfrm_state_delete_tunnel(struct xfrm_state *x)
}
EXPORT_SYMBOL(xfrm_state_delete_tunnel);

/*
* This function is NOT optimal. For example, with ESP it will give an
* MTU that's usually two bytes short of being optimal. However, it will
* usually give an answer that's a multiple of 4 provided the input is
* also a multiple of 4.
*/
int xfrm_state_mtu(struct xfrm_state *x, int mtu)
{
int res = mtu;
Expand Down

0 comments on commit e60ad10

Please sign in to comment.