search for: hlen

Displaying 20 results from an estimated 97 matches for "hlen".

Did you mean: alen
2007 Jan 05
1
[PATCH] Re: [Xen-staging] [xen-unstable] [XEN] Avoid use of GNU-specific memmem().
...GNU-specific memmem(). > --- a/xen/tools/symbols.c Wed Jan 03 23:53:27 2007 +0000 > +++ b/xen/tools/symbols.c Thu Jan 04 10:17:34 2007 +0000 > @@ -350,6 +350,14 @@ static void build_initial_tok_table(void > table_cnt = pos; > } > > +static void *memmem_pvt(void *h, size_t hlen, void *n, size_t nlen) > +{ > + char *p; > + for (p = h; (p - (char *)h) <= (hlen - nlen); p++) > + if (!memcmp(p, n, nlen)) return p; > + return NULL; > +} size_t is unsigned, (hlen - nlen) can wrap and cause a segfault. The patch below fixes it. Thanks, Alex Signed-...
2015 Jul 06
7
[PATCH 1/1] paint visual host key with unicode box-drawing characters
...LDSIZE_X; x++) *p++ = augmentation_string[MIN(field[x][y], len)]; - *p++ = '|'; + p += sprintf(p, "%s", border[3]); *p++ = '\n'; } /* output lower border */ - *p++ = '+'; + p += sprintf(p, "%s", border[4]); for (i = 0; i < (FLDSIZE_X - hlen) / 2; i++) - *p++ = '-'; + p += sprintf(p, "%s", border[1]); memcpy(p, hash, hlen); p += hlen; for (i += hlen; i < FLDSIZE_X; i++) - *p++ = '-'; - *p++ = '+'; + p += sprintf(p, "%s", border[1]); + p += sprintf(p, "%s", border[5]);...
2015 Jul 06
2
[PATCH 1/1] paint visual host key with unicode box-drawing characters
Le 06/07/15 12:33, Alex Bligh a ?crit : > On 6 Jul 2015, at 11:05, Christian Hesse <list at eworm.de> wrote: > >> +#ifdef HAVE_LOCALE_H >> + char *locale; >> + char *border_utf8[] = { "?", "?", "?", "?", "?", "?" }; >> +#endif >> + char *border_ascii[] = { "+", "-",
2020 Mar 19
0
[nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
...conditions are @@ -193,29 +193,42 @@ sh_preconnect (int readonly) } } +struct sh_handle { + int can_flush; + int can_zero; + char *h; +}; + void * sh_open (int readonly) { const char *method = "open"; const char *script = get_script (method); - char *h = NULL; size_t hlen; const char *args[] = { script, method, readonly ? "true" : "false", nbdkit_export_name () ? : "", NULL }; + struct sh_handle *h = malloc (sizeof *h); + + if (!h) { + nbdkit_error ("malloc: %m"); + return NULL; + } + h-&...
2015 Jul 06
3
[PATCH v2 1/1] paint visual host key with unicode box-drawing characters
...", "+", "+" }; + char **border; char *augmentation_string = " .o+=*BOX@%&#/^SE"; - char *retval, *p, title[FLDSIZE_X], hash[FLDSIZE_X]; + char *retval, *p, title[FLDSIZE_X - 2], hash[FLDSIZE_X - 2]; u_char field[FLDSIZE_X][FLDSIZE_Y]; size_t i, tlen, hlen; u_int b; int x, y, r; size_t len = strlen(augmentation_string) - 1; - if ((retval = calloc((FLDSIZE_X + 3), (FLDSIZE_Y + 2))) == NULL) + if ((retval = malloc((FLDSIZE_X + 7) * FLDSIZE_Y + FLDSIZE_X * 3 * 2)) == NULL) return NULL; +#ifdef HAVE_LOCALE_H + /* initialize locale */ + se...
2017 Nov 22
1
[PATCH 01/32] bios/vpstate: There are some fermi vbios with no boost or tdp entry
...t nvbios_vpstate_header *h) > h->ecount = nvbios_rd08(b, h->offset + 0x5); > > h->base_id = nvbios_rd08(b, h->offset + 0x0f); > - h->boost_id = nvbios_rd08(b, h->offset + 0x10); > - h->tdp_id = nvbios_rd08(b, h->offset + 0x11); > + if (h->hlen > 0x10) > + h->boost_id = nvbios_rd08(b, h->offset + 0x10); > + else > + h->boost_id = 0xff; > + if (h->hlen > 0x11) > + h->tdp_id = nvbios_rd08(b, h->offset + 0x11); > + else > + h->tdp_id = 0xff; > return 0; > default: >...
2015 Sep 24
2
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
..., vnet_hdr.hdr_len) > len) > + if (__virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len) > len) > goto out_unlock; > > if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -2731,7 +2733,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) > hlen = LL_RESERVED_SPACE(dev); > tlen = dev->needed_tailroom; > skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, > - __virtio16_to_cpu(false, vnet_hdr.hdr_len), > + __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len), > msg->msg_flags & MSG_DONTWAIT,...
2015 Sep 24
2
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
..., vnet_hdr.hdr_len) > len) > + if (__virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len) > len) > goto out_unlock; > > if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -2731,7 +2733,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) > hlen = LL_RESERVED_SPACE(dev); > tlen = dev->needed_tailroom; > skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, > - __virtio16_to_cpu(false, vnet_hdr.hdr_len), > + __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len), > msg->msg_flags & MSG_DONTWAIT,...
2016 Nov 30
3
[PATCH v3 1/3] nvbios/power_budget: Add basic power budget parsing
...f __NVBIOS_POWER_BUDGET_H__ > +#define __NVBIOS_POWER_BUDGET_H__ > + > +#include <nvkm/subdev/bios.h> > + > +struct nvbios_power_budget_entry { > + u32 min_w; > + u32 avg_w; > + u32 max_w; > +}; > + > +struct nvbios_power_budget { > + u32 offset; > + u8 hlen; > + u8 elen; > + u8 ecount; > + u8 cap_entry; > +}; > + > +int nvbios_power_budget_header(struct nvkm_bios *, > + struct nvbios_power_budget *); > +int nvbios_power_budget_entry(struct nvkm_bios *, struct nvbios_power_budget *, > +...
2017 Oct 08
1
[RFC PATCH 15/29] bios: add thermal policies table
...--- /dev/null > +++ b/drm/nouveau/include/nvkm/subdev/bios/thermal_policies.h > @@ -0,0 +1,27 @@ > +#ifndef __NVBIOS_THERMAL_POLICIES_H__ > +#define __NVBIOS_THERMAL_POLICIES_H__ > + > +struct nvbios_thermal_policies_header { > + u32 offset; > + > + u8 version; > + u8 hlen; > + u8 ecount; > + u8 elen; > +}; > +struct nvbios_thermal_policies_entry { > + u8 mode; > + u16 t0; > + u16 t1; > + u16 t2; > + s16 down_offset; > + s16 up_offset; > +}; > + > +int nvbios_thermal_policies_parse(struct nvkm_bios *, > + struct nvbios_...
2016 Apr 27
2
[Announcement] Tinc version 1.1pre12 released
On Wed, Apr 27, 2016 at 05:15:57PM +0800, hshh wrote: > >Updated support for BSD tun/tap devices. > It is broken on FreeBSD tun. > > tcpdump on tun, > 09:05:07.458988 IP0 bad-hlen 0 Can you show me your tinc.conf and tinc-up script? Also, which version of FreeBSD are you using? -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type:...
2016 Nov 30
1
[PATCH v3 1/3] nvbios/power_budget: Add basic power budget parsing
...ubdev/bios.h> >>> + >>> +struct nvbios_power_budget_entry { >>> + u32 min_w; >>> + u32 avg_w; >>> + u32 max_w; >>> +}; >>> + >>> +struct nvbios_power_budget { >>> + u32 offset; >>> + u8 hlen; >>> + u8 elen; >>> + u8 ecount; >>> + u8 cap_entry; >>> +}; >>> + >>> +int nvbios_power_budget_header(struct nvkm_bios *, >>> + struct nvbios_power_budget *); >>> +int nvbios_power_...
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh plugin itself was calling .can_flush twice in some situations (in order to default .can_fua). Then right after, I regressed it to call .can_zero twice (in order to default .can_fast_zero). I also missed that .thread_model could use better caching, because at the time, I did not add testsuite coverage. Fix that now. Eric Blake
2017 Sep 15
0
[RFC PATCH 15/29] bios: add thermal policies table
...es.h new file mode 100644 index 00000000..c9215fdd --- /dev/null +++ b/drm/nouveau/include/nvkm/subdev/bios/thermal_policies.h @@ -0,0 +1,27 @@ +#ifndef __NVBIOS_THERMAL_POLICIES_H__ +#define __NVBIOS_THERMAL_POLICIES_H__ + +struct nvbios_thermal_policies_header { + u32 offset; + + u8 version; + u8 hlen; + u8 ecount; + u8 elen; +}; +struct nvbios_thermal_policies_entry { + u8 mode; + u16 t0; + u16 t1; + u16 t2; + s16 down_offset; + s16 up_offset; +}; + +int nvbios_thermal_policies_parse(struct nvkm_bios *, + struct nvbios_thermal_policies_header *); +int nvbios_thermal_policies_entry(struct...
2016 Mar 17
0
[PATCH 03/19] bios: add parsing of BASE CLOCK table
...u/include/nvkm/subdev/bios/baseclock.h new file mode 100644 index 0000000..eca7b4a --- /dev/null +++ b/drm/nouveau/include/nvkm/subdev/bios/baseclock.h @@ -0,0 +1,24 @@ +#ifndef __NVBIOS_BASECLOCK_H__ +#define __NVBIOS_BASECLOCK_H__ +struct nvbios_baseclk_header { + u16 offset; + + u8 version; + u8 hlen; + u8 ecount; + u8 elen; + u8 scount; + u8 slen; + + u8 base; + u8 boost; + u8 tdp; +}; +struct nvbios_baseclk_entry { + u8 pstate; + u16 clock_mhz; +}; +int nvbios_baseclock_parse(struct nvkm_bios *, struct nvbios_baseclk_header *); +int nvbios_baseclock_entry(struct nvkm_bios *, struct nvbios_ba...
2015 Sep 24
1
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
..., vnet_hdr.hdr_len) > len) > + if (__virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len) > len) > goto out_unlock; > > if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -2731,7 +2733,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) > hlen = LL_RESERVED_SPACE(dev); > tlen = dev->needed_tailroom; > skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, > - __virtio16_to_cpu(false, vnet_hdr.hdr_len), > + __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len), > msg->msg_flags & MSG_DONTWAIT,...
2015 Sep 24
1
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
..., vnet_hdr.hdr_len) > len) > + if (__virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len) > len) > goto out_unlock; > > if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -2731,7 +2733,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) > hlen = LL_RESERVED_SPACE(dev); > tlen = dev->needed_tailroom; > skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, > - __virtio16_to_cpu(false, vnet_hdr.hdr_len), > + __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len), > msg->msg_flags & MSG_DONTWAIT,...
2016 Nov 30
4
[PATCH v3 0/3] Expose power budget cap via hwmon
There is an optinal header field in the power budget table we can use to read out the power cap of the GPU. We should have this in the kernel before actually using it to catch errors and see how reliable this is, but as it seems it works on all GPUs as expected on Kepler und Maxwells with the power cap field set in the vbios. This series keeps things really simple for now until we figure out
2015 Sep 24
0
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
...> > + if (__virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len) > len) > > goto out_unlock; > > > > if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) { > > @@ -2731,7 +2733,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) > > hlen = LL_RESERVED_SPACE(dev); > > tlen = dev->needed_tailroom; > > skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, > > - __virtio16_to_cpu(false, vnet_hdr.hdr_len), > > + __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len), > > msg->msg_...
2016 Nov 30
0
[PATCH v3 1/3] nvbios/power_budget: Add basic power budget parsing
.../include/nvkm/subdev/bios/power_budget.h @@ -0,0 +1,25 @@ +#ifndef __NVBIOS_POWER_BUDGET_H__ +#define __NVBIOS_POWER_BUDGET_H__ + +#include <nvkm/subdev/bios.h> + +struct nvbios_power_budget_entry { + u32 min_w; + u32 avg_w; + u32 max_w; +}; + +struct nvbios_power_budget { + u32 offset; + u8 hlen; + u8 elen; + u8 ecount; + u8 cap_entry; +}; + +int nvbios_power_budget_header(struct nvkm_bios *, + struct nvbios_power_budget *); +int nvbios_power_budget_entry(struct nvkm_bios *, struct nvbios_power_budget *, + u8 idx, struct nvbios_...