mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-13 01:44:38 +08:00
Several fixed from HEAD merged in.
This commit is contained in:
parent
52dd00b217
commit
0912877fd7
@ -300,9 +300,10 @@ inet_chksum_pbuf(struct pbuf *p)
|
|||||||
/* Convert numeric IP address into decimal dotted ASCII representation.
|
/* Convert numeric IP address into decimal dotted ASCII representation.
|
||||||
* returns ptr to static buffer; not reentrant!
|
* returns ptr to static buffer; not reentrant!
|
||||||
*/
|
*/
|
||||||
u8_t *inet_ntoa(u32_t addr)
|
char *inet_ntoa(struct in_addr addr)
|
||||||
{
|
{
|
||||||
static u8_t str[16];
|
static u8_t str[16];
|
||||||
|
u32_t s_addr = addr.s_addr;
|
||||||
u8_t inv[3];
|
u8_t inv[3];
|
||||||
u8_t *rp;
|
u8_t *rp;
|
||||||
u8_t *ap;
|
u8_t *ap;
|
||||||
@ -311,7 +312,7 @@ u8_t *inet_ntoa(u32_t addr)
|
|||||||
u8_t i;
|
u8_t i;
|
||||||
|
|
||||||
rp = str;
|
rp = str;
|
||||||
ap = (u8_t *)&addr;
|
ap = (u8_t *)&s_addr;
|
||||||
for(n = 0; n < 4; n++) {
|
for(n = 0; n < 4; n++) {
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
|
@ -172,7 +172,7 @@ netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr)
|
|||||||
/* address is actually being changed? */
|
/* address is actually being changed? */
|
||||||
if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0)
|
if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0)
|
||||||
{
|
{
|
||||||
extern struct tcp_pcb *tcp_active_pcbs;
|
/* extern struct tcp_pcb *tcp_active_pcbs; defined by tcp.h */
|
||||||
LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: netif address being changed\n"));
|
LWIP_DEBUGF(NETIF_DEBUG | 1, ("netif_set_ipaddr: netif address being changed\n"));
|
||||||
pcb = tcp_active_pcbs;
|
pcb = tcp_active_pcbs;
|
||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
@ -187,7 +187,7 @@ netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr)
|
|||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (lpcb = tcp_listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
|
for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
|
||||||
/* PCB bound to current local interface address? */
|
/* PCB bound to current local interface address? */
|
||||||
if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) {
|
if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) {
|
||||||
/* The PCB is listening to the old ipaddr and
|
/* The PCB is listening to the old ipaddr and
|
||||||
|
@ -47,8 +47,8 @@
|
|||||||
#include "lwip/def.h"
|
#include "lwip/def.h"
|
||||||
#include "lwip/memp.h"
|
#include "lwip/memp.h"
|
||||||
#include "lwip/inet.h"
|
#include "lwip/inet.h"
|
||||||
#include "lwip/netif.h"
|
|
||||||
#include "lwip/ip_addr.h"
|
#include "lwip/ip_addr.h"
|
||||||
|
#include "lwip/netif.h"
|
||||||
#include "lwip/raw.h"
|
#include "lwip/raw.h"
|
||||||
|
|
||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
|
@ -174,6 +174,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
|
|||||||
(void *)timeout, msecs, (void *)h, (void *)arg));
|
(void *)timeout, msecs, (void *)h, (void *)arg));
|
||||||
|
|
||||||
LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);
|
LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);
|
||||||
|
|
||||||
if (timeouts->next == NULL) {
|
if (timeouts->next == NULL) {
|
||||||
timeouts->next = timeout;
|
timeouts->next = timeout;
|
||||||
return;
|
return;
|
||||||
|
@ -46,7 +46,7 @@ u16_t inet_chksum_pseudo(struct pbuf *p,
|
|||||||
|
|
||||||
u32_t inet_addr(const char *cp);
|
u32_t inet_addr(const char *cp);
|
||||||
int inet_aton(const char *cp, struct in_addr *addr);
|
int inet_aton(const char *cp, struct in_addr *addr);
|
||||||
u8_t *inet_ntoa(u32_t addr); /* returns ptr to static buffer; not reentrant! */
|
char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reentrant! */
|
||||||
|
|
||||||
#ifdef htons
|
#ifdef htons
|
||||||
#undef htons
|
#undef htons
|
||||||
|
@ -34,6 +34,28 @@
|
|||||||
|
|
||||||
#include "lwip/arch.h"
|
#include "lwip/arch.h"
|
||||||
|
|
||||||
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
# include "arch/bpstruct.h"
|
||||||
|
#endif
|
||||||
|
PACK_STRUCT_BEGIN
|
||||||
|
struct ip_addr {
|
||||||
|
PACK_STRUCT_FIELD(u32_t addr);
|
||||||
|
} PACK_STRUCT_STRUCT;
|
||||||
|
PACK_STRUCT_END
|
||||||
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
# include "arch/epstruct.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For compatibility with BSD code */
|
||||||
|
struct in_addr {
|
||||||
|
u32_t s_addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct netif;
|
||||||
|
|
||||||
|
extern const struct ip_addr ip_addr_any;
|
||||||
|
extern const struct ip_addr ip_addr_broadcast;
|
||||||
|
|
||||||
/** IP_ADDR_ can be used as a fixed IP address
|
/** IP_ADDR_ can be used as a fixed IP address
|
||||||
* for the wildcard and the broadcast address
|
* for the wildcard and the broadcast address
|
||||||
*/
|
*/
|
||||||
@ -76,25 +98,6 @@
|
|||||||
|
|
||||||
#define IN_LOOPBACKNET 127 /* official! */
|
#define IN_LOOPBACKNET 127 /* official! */
|
||||||
|
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
|
||||||
# include "arch/bpstruct.h"
|
|
||||||
#endif
|
|
||||||
PACK_STRUCT_BEGIN
|
|
||||||
struct ip_addr {
|
|
||||||
PACK_STRUCT_FIELD(u32_t addr);
|
|
||||||
} PACK_STRUCT_STRUCT;
|
|
||||||
PACK_STRUCT_END
|
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
|
||||||
# include "arch/epstruct.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For compatibility with BSD code */
|
|
||||||
struct in_addr {
|
|
||||||
u32_t s_addr;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const struct ip_addr ip_addr_any;
|
|
||||||
extern const struct ip_addr ip_addr_broadcast;
|
|
||||||
|
|
||||||
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
|
#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = htonl(((u32_t)(a & 0xff) << 24) | ((u32_t)(b & 0xff) << 16) | \
|
||||||
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
|
((u32_t)(c & 0xff) << 8) | (u32_t)(d & 0xff))
|
||||||
|
@ -90,9 +90,7 @@ err_t udp_send (struct udp_pcb *pcb, struct pbuf *p);
|
|||||||
#define udp_flags(pcb) ((pcb)->flags)
|
#define udp_flags(pcb) ((pcb)->flags)
|
||||||
#define udp_setflags(pcb, f) ((pcb)->flags = (f))
|
#define udp_setflags(pcb, f) ((pcb)->flags = (f))
|
||||||
|
|
||||||
|
|
||||||
/* The following functions are the lower layer interface to UDP. */
|
/* The following functions are the lower layer interface to UDP. */
|
||||||
u8_t udp_lookup (struct ip_hdr *iphdr, struct netif *inp);
|
|
||||||
void udp_input (struct pbuf *p, struct netif *inp);
|
void udp_input (struct pbuf *p, struct netif *inp);
|
||||||
void udp_init (void);
|
void udp_init (void);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ int get_secret(
|
|||||||
|
|
||||||
addrs = NULL;
|
addrs = NULL;
|
||||||
|
|
||||||
if(!client || !client[0] && strcmp(client, ppp_settings.user)) {
|
if(!client || !client[0] || strcmp(client, ppp_settings.user)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*
|
*
|
||||||
* $Id: chpms.h,v 1.2 2003/11/14 14:56:31 likewise Exp $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CHPMS_H
|
#ifndef CHPMS_H
|
||||||
|
@ -178,6 +178,20 @@ static fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */
|
|||||||
/*** LOCAL FUNCTION DEFINITIONS ***/
|
/*** LOCAL FUNCTION DEFINITIONS ***/
|
||||||
/**********************************/
|
/**********************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Non-standard inet_ntoa left here for compat with original ppp
|
||||||
|
* sources. Assumes u32_t instead of struct in_addr.
|
||||||
|
*/
|
||||||
|
|
||||||
|
char * _inet_ntoa(u32_t n)
|
||||||
|
{
|
||||||
|
struct in_addr ia;
|
||||||
|
ia.s_addr = n;
|
||||||
|
return inet_ntoa(ia);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define inet_ntoa _inet_ntoa
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ipcp_init - Initialize IPCP.
|
* ipcp_init - Initialize IPCP.
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Definitions for tcp compression routines.
|
* Definitions for tcp compression routines.
|
||||||
*
|
*
|
||||||
* $Id: vj.h,v 1.3 2003/11/14 14:56:31 likewise Exp $
|
|
||||||
*
|
|
||||||
* Copyright (c) 1989 Regents of the University of California.
|
* Copyright (c) 1989 Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user