* RE: [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper
@ 2006-01-24 19:36 Greg Scott
2006-01-25 8:47 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Greg Scott @ 2006-01-24 19:36 UTC (permalink / raw)
To: Patrick McHardy, Holger Eitzenberger; +Cc: netfilter-devel
I've always wondered - patches for modules in POM-NG are available right
away with the next daily snapshot. But the PPTP stuff is now in the
mainline kernel. Would this patch end up in one of the snapshot or rc
releases on kernel.org, or are there updates to the 2.6.15.1 tree or how
does that work? Or would the most up to date PPTP stuff still be in
POM-NG?
Thanks
- Greg Scott
-----Original Message-----
From: netfilter-devel-bounces@lists.netfilter.org
[mailto:netfilter-devel-bounces@lists.netfilter.org] On Behalf Of
Patrick McHardy
Sent: Tuesday, January 24, 2006 12:00 PM
To: Holger Eitzenberger
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper
Holger Eitzenberger wrote:
> The recent (kernel 2.6.15.1) fix for PPTP NAT helper introduced a bug
> - which only appears if DEBUGP is enabled though.
>
> The calculation of the CID offset into a PPTP request struct is not
> correct, so that at least not the correct CID is displayed if DEBUGP
> is enabled.
>
> This patch corrects CID offset calculation and introduces a #define
> for that.
That was my bad. Patch applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper 2006-01-24 19:36 [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper Greg Scott @ 2006-01-25 8:47 ` Patrick McHardy 0 siblings, 0 replies; 4+ messages in thread From: Patrick McHardy @ 2006-01-25 8:47 UTC (permalink / raw) To: Greg Scott; +Cc: netfilter-devel Greg Scott wrote: > I've always wondered - patches for modules in POM-NG are available right > away with the next daily snapshot. But the PPTP stuff is now in the > mainline kernel. Would this patch end up in one of the snapshot or rc > releases on kernel.org, or are there updates to the 2.6.15.1 tree or how > does that work? Or would the most up to date PPTP stuff still be in > POM-NG? No, the PPtP patch in pomng is not updated anymore, just the version in the kernel. ^ permalink raw reply [flat|nested] 4+ messages in thread
* PPTP NAT helper fix @ 2006-01-24 13:49 Holger Eitzenberger 2006-01-24 13:49 ` [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper Holger Eitzenberger 0 siblings, 1 reply; 4+ messages in thread From: Holger Eitzenberger @ 2006-01-24 13:49 UTC (permalink / raw) To: netfilter-devel Hi, what follows is a patch for PPT NAT helper as of kernel version 2.6.15.1. Please apply. Thanks. /holger ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper 2006-01-24 13:49 PPTP NAT helper fix Holger Eitzenberger @ 2006-01-24 13:49 ` Holger Eitzenberger 2006-01-24 17:59 ` Patrick McHardy 0 siblings, 1 reply; 4+ messages in thread From: Holger Eitzenberger @ 2006-01-24 13:49 UTC (permalink / raw) To: netfilter-devel The recent (kernel 2.6.15.1) fix for PPTP NAT helper introduced a bug - which only appears if DEBUGP is enabled though. The calculation of the CID offset into a PPTP request struct is not correct, so that at least not the correct CID is displayed if DEBUGP is enabled. This patch corrects CID offset calculation and introduces a #define for that. Signed-off-by: Holger Eitzenberger <heitzenberger@astaro.com> --- net/ipv4/netfilter/ip_nat_helper_pptp.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) b4a2c7646fb828e47b2f6ed8c7794155204a97a9 diff --git a/net/ipv4/netfilter/ip_nat_helper_pptp.c b/net/ipv4/netfilter/ip_nat_helper_pptp.c index 50960cb..8fe3e34 100644 --- a/net/ipv4/netfilter/ip_nat_helper_pptp.c +++ b/net/ipv4/netfilter/ip_nat_helper_pptp.c @@ -52,6 +52,9 @@ #define IP_NAT_PPTP_VERSION "3.0" +#define REQ_CID(req, off) (*(u_int16_t *)((char *)(req) + (off))) + + MODULE_LICENSE("GPL"); MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>"); MODULE_DESCRIPTION("Netfilter NAT helper module for PPTP"); @@ -198,7 +201,7 @@ pptp_outbound_pkt(struct sk_buff **pskb, /* only OUT_CALL_REQUEST, IN_CALL_REPLY, CALL_CLEAR_REQUEST pass * down to here */ DEBUGP("altering call id from 0x%04x to 0x%04x\n", - ntohs(*(u_int16_t *)pptpReq + cid_off), ntohs(new_callid)); + ntohs(REQ_CID(pptpReq, cid_off)), ntohs(new_callid)); /* mangle packet */ if (ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, @@ -344,7 +347,7 @@ pptp_inbound_pkt(struct sk_buff **pskb, /* mangle packet */ DEBUGP("altering peer call id from 0x%04x to 0x%04x\n", - ntohs(*(u_int16_t *)pptpReq + pcid_off), ntohs(new_pcid)); + ntohs(REQ_CID(pptpReq, pcid_off)), ntohs(new_pcid)); rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, pcid_off + sizeof(struct pptp_pkt_hdr) + @@ -356,7 +359,7 @@ pptp_inbound_pkt(struct sk_buff **pskb, if (new_cid) { DEBUGP("altering call id from 0x%04x to 0x%04x\n", - ntohs(*(u_int16_t *)pptpReq + cid_off), ntohs(new_cid)); + ntohs(REQ_CID(pptpReq, cid_off)), ntohs(new_cid)); rv = ip_nat_mangle_tcp_packet(pskb, ct, ctinfo, cid_off + sizeof(struct pptp_pkt_hdr) + sizeof(struct PptpControlHeader), -- 1.0.GIT ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper 2006-01-24 13:49 ` [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper Holger Eitzenberger @ 2006-01-24 17:59 ` Patrick McHardy 0 siblings, 0 replies; 4+ messages in thread From: Patrick McHardy @ 2006-01-24 17:59 UTC (permalink / raw) To: Holger Eitzenberger; +Cc: netfilter-devel Holger Eitzenberger wrote: > The recent (kernel 2.6.15.1) fix for PPTP NAT helper introduced a > bug - which only appears if DEBUGP is enabled though. > > The calculation of the CID offset into a PPTP request struct is > not correct, so that at least not the correct CID is displayed > if DEBUGP is enabled. > > This patch corrects CID offset calculation and introduces a #define > for that. That was my bad. Patch applied, thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-25 8:47 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-01-24 19:36 [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper Greg Scott 2006-01-25 8:47 ` Patrick McHardy -- strict thread matches above, loose matches on Subject: below -- 2006-01-24 13:49 PPTP NAT helper fix Holger Eitzenberger 2006-01-24 13:49 ` [PATCH] [NETFILTER] Fix CID offset bug in PPTP NAT helper Holger Eitzenberger 2006-01-24 17:59 ` Patrick McHardy
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.