~ubuntu-branches/ubuntu/oneiric/openvpn/oneiric

« back to all changes in this revision

Viewing changes to forward.c

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2008-10-07 16:30:44 UTC
  • mfrom: (1.1.11 upstream) (10.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20081007163044-ixx04wg588z1972e
Tags: 2.1~rc11-1ubuntu1
* Merge with Debian (LP: #279655), remaining diffs:
  - debian/openvpn.init.d: Added 'status' action to init script, show
    per-VPN result messages and add "--script-security 2" by default for
    backwards compatibility
  - debian/control: Added lsb-base>=3.2-14 depend to allow status_of_proc()
* Fixes regression when calling commands with arguments (LP: #277447)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "mss.h"
32
32
#include "event.h"
33
33
#include "ps.h"
 
34
#include "dhcp.h"
34
35
 
35
36
#include "memdbg.h"
36
37
 
976
977
  if (!c->options.passtos)
977
978
    flags &= ~PIPV4_PASSTOS;
978
979
#endif
 
980
  if (!c->options.route_gateway_via_dhcp || !route_list_default_gateway_needed (c->c1.route_list))
 
981
    flags &= ~PIPV4_EXTRACT_DHCP_ROUTER;
979
982
 
980
983
  if (buf->len > 0)
981
984
    {
1001
1004
              /* possibly alter the TCP MSS */
1002
1005
              if (flags & PIPV4_MSSFIX)
1003
1006
                mss_fixup (&ipbuf, MTU_TO_MSS (TUN_MTU_SIZE_DYNAMIC (&c->c2.frame)));
 
1007
 
 
1008
              /* possibly extract a DHCP router message */
 
1009
              if (flags & PIPV4_EXTRACT_DHCP_ROUTER)
 
1010
                {
 
1011
                  const in_addr_t dhcp_router = dhcp_extract_router_msg (&ipbuf);
 
1012
                  route_list_add_default_gateway (c->c1.route_list, c->c2.es, dhcp_router);
 
1013
                }
1004
1014
            }
1005
1015
        }
1006
1016
    }
1149
1159
   * The --mssfix option requires
1150
1160
   * us to examine the IPv4 header.
1151
1161
   */
1152
 
  process_ipv4_header (c, PIPV4_MSSFIX|PIPV4_OUTGOING, &c->c2.to_tun);
 
1162
  process_ipv4_header (c, PIPV4_MSSFIX|PIPV4_EXTRACT_DHCP_ROUTER|PIPV4_OUTGOING, &c->c2.to_tun);
1153
1163
 
1154
1164
  if (c->c2.to_tun.len <= MAX_RW_SIZE_TUN (&c->c2.frame))
1155
1165
    {