aboutsummaryrefslogtreecommitdiffstats
path: root/core/fs/pxe/tcp.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-03-28 14:14:20 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2013-03-28 14:14:20 -0700
commit66d551acdb0d516f43702983184483687c2128e4 (patch)
tree61c263c4bb15a192909c6f2928cd430ffaf31f52 /core/fs/pxe/tcp.c
parenta107cb3b6fa219cf5f65bef366c9b00b108e9a3a (diff)
downloadsyslinux-66d551acdb0d516f43702983184483687c2128e4.tar.gz
syslinux-66d551acdb0d516f43702983184483687c2128e4.tar.xz
syslinux-66d551acdb0d516f43702983184483687c2128e4.zip
pxe: disentangle the legacy and lwip stacks without #ifdef
Disentangle the dependencies via the legacy and the lwip stacks. Now there are no more #ifdefs (except for a single one in pxelinux.asm) and the only difference between the pxelinux and lpxelinux archives are which files are included. To make this happen: 1. Replace the private part of the socket structure with a union. 2. Move the list of URL methods into a stack-dependent file. Reported-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core/fs/pxe/tcp.c')
-rw-r--r--core/fs/pxe/tcp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/fs/pxe/tcp.c b/core/fs/pxe/tcp.c
index 528fbce8..90761978 100644
--- a/core/fs/pxe/tcp.c
+++ b/core/fs/pxe/tcp.c
@@ -25,13 +25,13 @@ void tcp_close_file(struct inode *inode)
{
struct pxe_pvt_inode *socket = PVT(inode);
- if (socket->private.conn) {
- netconn_delete(socket->private.conn);
- socket->private.conn = NULL;
+ if (socket->net.lwip.conn) {
+ netconn_delete(socket->net.lwip.conn);
+ socket->net.lwip.conn = NULL;
}
- if (socket->private.buf) {
- netbuf_delete(socket->private.buf);
- socket->private.buf = NULL;
+ if (socket->net.lwip.buf) {
+ netbuf_delete(socket->net.lwip.buf);
+ socket->net.lwip.buf = NULL;
}
}
@@ -43,16 +43,16 @@ void tcp_fill_buffer(struct inode *inode)
err_t err;
/* Clean up or advance an inuse netbuf */
- if (socket->private.buf) {
- if (netbuf_next(socket->private.buf) < 0) {
- netbuf_delete(socket->private.buf);
- socket->private.buf = NULL;
+ if (socket->net.lwip.buf) {
+ if (netbuf_next(socket->net.lwip.buf) < 0) {
+ netbuf_delete(socket->net.lwip.buf);
+ socket->net.lwip.buf = NULL;
}
}
/* If needed get a new netbuf */
- if (!socket->private.buf) {
- err = netconn_recv(socket->private.conn, &(socket->private.buf));
- if (!socket->private.buf || err) {
+ if (!socket->net.lwip.buf) {
+ err = netconn_recv(socket->net.lwip.conn, &(socket->net.lwip.buf));
+ if (!socket->net.lwip.buf || err) {
socket->tftp_goteof = 1;
if (inode->size == -1)
inode->size = socket->tftp_filepos;
@@ -61,7 +61,7 @@ void tcp_fill_buffer(struct inode *inode)
}
}
/* Report the current fragment of the netbuf */
- err = netbuf_data(socket->private.buf, &data, &len);
+ err = netbuf_data(socket->net.lwip.buf, &data, &len);
if (err) {
printf("netbuf_data err: %d\n", err);
kaboom();